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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform textbox trouble! 1

Status
Not open for further replies.

DaveShmave

Programmer
Dec 30, 2000
40
US
Hi,

I have a text box on a subform (Access 97) with this as the control source:

=[Forms]![frmOrdersSubform].[cboSubParts].[Column](1)

Now when I open the main form (with the embedded Subform) the text box has '#Name?' displayed. However, if I leave the form open, go to the database window and open the Subform the text displays the information perfectly.

I have checked my spelling and everything else I can think of and all appears correct.

So how do I modify the expression above so that the text displays when the main form is open and displaying the subform?

TIA

David
 
Your problem occurs because, when the subform is opened in a subform control and not open separately, it is not present in the Forms collection. The Forms collection only contains forms that are opened directly.

Assuming you won't actually use the subform by itself, you can change the Control Source to:
=[Forms]![frmMainForm]![subformcontrolname].Form![cboSubParts].[Column](1)

This expression will only work when the subform is opened in a subform control in frmMainForm.

I'm not sure it will work, but you might also try:
=Me![cboSubParts].[Column](1)
If it works, it will work wherever the subform is used. Rick Sprague
 
Thanks so much, your solution works perfectly. I knew I was missing something rather simple.

After posting I played around and got fairly close but still no cigar.

So again, thank you.

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top