Form/SubForm link

Stemdriller

Registered User.
Local time
Today, 23:19
Joined
May 29, 2008
Messages
187
Hi Everyone

If I have a main form called frmTest and within that form I have a subform called frmTestSubForm, which are linked correctly.

If frmTestSubForm has a text box called txtIssuedby how can I display that on the main frmTest.

I have tried Forms!frmTestSubForm!txtIssuedby but just get Name?

Thanks
gareth
 
On the Control Source of the textbox (located on the main form) that you would want the value displayed, click on the ellipsis button (it's like three dots) and brings up the Expression Builder. Use that to locate txtIssuedBy and when found double click on the name in the middle pane.
 
you can just do

subformcontrolname!txtissuedby

subformcontrolname is the name of the CONTROL on the main form - which may or may not be the same as the form name - it may be just subdetails, or something similar. If there is a space in the name you need

[subformcontrolname]
 
Gemma

Thanks, that did it

Dropping the 'forms!' at the beginning
 
The Expression Builder is a good learning tool for those that don't know how to correctly reference.
 
Gemma

Thanks, that did it

Dropping the 'forms!' at the beginning


yes - because you arent referring to a form - you are actually referring to a control within another control

note that you can actually refer explictily to the (sub)form - but the syntax is different, and its one I ALWAYS have to look up carefully
 
Thanks both for responding

Along the same lines my text box in the main needs more info from the sub form, the last revision number of a Contract number

I am using this
=MAX([tblRevisions].[Form]![RevisionNumber])

But i get the dreaded 'Error!'

Taking the =MAX away gives me a figure but not the most recent.

Any tips
 

Users who are viewing this thread

Back
Top Bottom