Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subforms- displaying information from another feild

Status
Not open for further replies.

oggsta

Technical User
Jun 22, 2002
41
GB
I have a form called Main,
There is subfrom called Sheets1 within the Main form
and a subform below that called TLR within Sheets1 form.

When I open main, both Forms sheet1 and TLR will be open and displayed.

I have a feild in Sheet1 called Forms!sheet1[deso] and i would like a feild in the form TLR to automatically reflect the informataion in the feild Forms!sheet1![deso].

The problem is that wehn i put in the folowing in thw control sorse in my TLR feild, Forms!sheet1![deso], the information does not appear in the form because i veiw this when i open the Main form, if i was to open Sheet1 form the information would appear.

Any ideas on how to ensure this information appears when i open the Main from would be appreciated.
 
Try referencing the main form in your expression like so...


=[Forms]![MAINFORM]![MYSUBFORM].[Form]![FieldName]


Hope this helps

ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
Thanks, is it possible to link them together so that if you update one feild the other updates
 
Yes it is.

1. Go to the first subform's design view.
2. Click the textbox that you will be updating.
3. Open the property window and go to the After Update event for this textbox.
4. In the After Update event procedure you can put VBA code to requery (refresh) the textbox on the second subform like so...


Private Sub TheName_AfterUpdate()
Me![SecondSubformName].Form![TextBoxName].Requery
End Sub


Happy coding...






ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top