A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Problems referencing Subform Control from another subform



 
 
Thread Tools Display Modes
  #1  
Old June 29th, 2009, 04:55 PM posted to microsoft.public.access.forms
John Lane
external usenet poster
 
Posts: 69
Default Problems referencing Subform Control from another subform

How do you reference a subform control when "in" another subform? I want to
use the On Current event in subform a to populate data in subform b.

Using the syntax below in the On Current Evetn of subform "a" I get the
error message: "You entered an expression that has an invalid reference to
the property Form/Report". When I put the statement in the main form, it
works. Thanks.

MsgBox "y = " & Forms!frmAccountRegister!subfrmTabs!C_CN
  #2  
Old June 29th, 2009, 05:07 PM posted to microsoft.public.access.forms
Arvin Meyer MVP
external usenet poster
 
Posts: 640
Default Problems referencing Subform Control from another subform


"John Lane" wrote in message
...
How do you reference a subform control when "in" another subform? I want
to
use the On Current event in subform a to populate data in subform b.


Me.Parent.NameOfSubformB.Form.ControlName
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


  #3  
Old June 29th, 2009, 05:22 PM posted to microsoft.public.access.forms
John Lane
external usenet poster
 
Posts: 69
Default Problems referencing Subform Control from another subform

Doesn't work. Same message. Am usign Access 2007 i that's any help. Also, in
the off chance you typed a dot when an ! oughtas be, I tried it both ways and
still didn't work.

"Arvin Meyer MVP" wrote:


"John Lane" wrote in message
...
How do you reference a subform control when "in" another subform? I want
to
use the On Current event in subform a to populate data in subform b.


Me.Parent.NameOfSubformB.Form.ControlName
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



  #4  
Old June 29th, 2009, 05:44 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default Problems referencing Subform Control from another subform

"John Lane" wrote in message
...
How do you reference a subform control when "in" another subform? I want
to
use the On Current event in subform a to populate data in subform b.

Using the syntax below in the On Current Evetn of subform "a" I get the
error message: "You entered an expression that has an invalid reference to
the property Form/Report". When I put the statement in the main form, it
works. Thanks.

MsgBox "y = " & Forms!frmAccountRegister!subfrmTabs!C_CN



Double-check the name of the subform. In your expression, you must use the
name of the subform *control* on the parent form, which may or may not be
the name of the form object it displays.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

  #5  
Old June 29th, 2009, 06:00 PM posted to microsoft.public.access.forms
John Lane
external usenet poster
 
Posts: 69
Default Problems referencing Subform Control from another subform

Ah, the wonderful inconsistencies of Microsft software! After all the
subforms are "fully" open, it works. I looks like it fails when the forms
first open up. Maybe there is no reference to the 2nd subform when the On
Current fires on the first subform. Or something. I am sure the Microsoft
developers have some perfectly plausible, yet useless answer why.

"Dirk Goldgar" wrote:

"John Lane" wrote in message
...
How do you reference a subform control when "in" another subform? I want
to
use the On Current event in subform a to populate data in subform b.

Using the syntax below in the On Current Evetn of subform "a" I get the
error message: "You entered an expression that has an invalid reference to
the property Form/Report". When I put the statement in the main form, it
works. Thanks.

MsgBox "y = " & Forms!frmAccountRegister!subfrmTabs!C_CN



Double-check the name of the subform. In your expression, you must use the
name of the subform *control* on the parent form, which may or may not be
the name of the form object it displays.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

  #6  
Old June 29th, 2009, 06:36 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default Problems referencing Subform Control from another subform

"John Lane" wrote in message
...
Ah, the wonderful inconsistencies of Microsft software! After all the
subforms are "fully" open, it works. I looks like it fails when the forms
first open up. Maybe there is no reference to the 2nd subform when the On
Current fires on the first subform. Or something.


Possibly. Subforms are loaded before their parent forms; that's a given.
For the rest, I can see that it might be a timing problem as independent
threads execute.

I am sure the Microsoft
developers have some perfectly plausible, yet useless answer why.


I don't se the value of that remark.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:59 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.