Textbox Control Source (1 Viewer)

bbulla

I'd rather be golfing
Local time
Today, 17:15
Joined
Feb 11, 2005
Messages
101
For some reason I can't get this to work:

I have a form, with a tab control on it. Each tab has a subform to display data. One tab is meant to be a summary tab of the rest, so I want to pull data from certain controls on each of the other tabs to display on the Summary tab.

If I set the ControlSource to Forms!subfrmLABOUR!txtTotalHours.Value the control just displays #Name?

I assume that means it can't reference the ControlSource. Is it just a syntax thing? I've tried various methods, but no luck.

Thanks,
 

bbulla

I'd rather be golfing
Local time
Today, 17:15
Joined
Feb 11, 2005
Messages
101
Still no luck: =me!subfrmLABOUR.Form!txtTotalHours.Value

gives me the same error as before.

The strange thing is that if I create a button on the main form and have a Click event like this:

msgbox Me!subfrmLABOUR.Form!txtTotalHours.Value

it works!! Is there a property of the text box that I need to change??
 

RuralGuy

AWF VIP
Local time
Today, 15:15
Joined
Jul 2, 2005
Messages
13,826
Are you attempting to display this information on yet another SubForm on that last tab? If so then it MIGHT be easier to go through the Forms collection.
Forms.YOURFORMNAME.subfrmLABOUR.Form!txtTotalHours.Value
 

bbulla

I'd rather be golfing
Local time
Today, 17:15
Joined
Feb 11, 2005
Messages
101
Ah.....your a genius! I guess since I am using a tab control, I needed to reference the main form first (not 'me'), and then work my way back down to the subform.

Thanks for your help!
 

RuralGuy

AWF VIP
Local time
Today, 15:15
Joined
Jul 2, 2005
Messages
13,826
You're certainly welcome but what you had should have worked. Ah well, as another helper likes to say: There is more than one way to skin a cat!
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 07:15
Joined
Jan 20, 2009
Messages
12,853
You were referring to a different subform on the same main form.
Code:
Me.Parent!subfrmLABOUR.Form!txtTotalHours
 

Users who are viewing this thread

Top Bottom