Referring to subforms - can't find field???

  • Thread starter Thread starter Brook
  • Start date Start date
B

Brook

Guest
Hi guys,

This is driving me nuts, I can't do anything on my program until I get this thing working.

Very simple, one large Mainform. The header of the mainform contains txtMainform. In the detail of the mainform is Subform1, with the text box txtSubform1. In the footer of Mainform is Subform2, with txtSubform2. I would like for the text in txtSubform2 to appear in txtSubform1 and txtMainform. I have used the following syntax:

Forms![Mainform]![txtMainform] = Me.txtSubform2

Forms![Mainform]![Subform1].Form.txtSubform1 = Me.txtSubform2

The first one works, but not the second - it keeps telling me it can't find the field Subform1, but Subform1 is not a field! I read in help that it might have something to do with LinkChildFields, but the thing is that the MainForm and Subform1 aren't based on a table... and my computer is in German so I don't understand everything. This is driving me nuts! I have tried so many combinations of things... please help.
If this doesn't work I have to redesign my whole database.

TIA Brook
 
Shouldn't the second one be Forms![Mainform]![Subform1].txtSubForm1 (lose the 2nd 'form')? Try that...
 
Forms![Mainform]![Subform1].Form!txtSubform1
or Forms![Mainform]![Subform1 subform].Form!txtSubform1
 
Dont' refer to the name of the subform. Click on the subform control in design view and check it's name. Thats what you reference.

If you have a subform control called Child32, on a mainform called "frmMain" and you wanted to refer to a subform field called txtName, this is how:

Forms!frmMain.Form!Child32!Name


[This message has been edited by Jimbob (edited 03-27-2002).]
 

Users who are viewing this thread

Back
Top Bottom