form doesn't work as a subform

umair434

Registered User.
Local time
Today, 04:26
Joined
Jul 8, 2011
Messages
186
Hi,

I have a form called frmReportdates - This form has two text boxes txtfrom and txtto (for the dates) & a clickable button which opens the report -

In the query of the report I set the dte criteria to :

Between [forms]![frmReportdates]![txtFrom] And [forms]![frmReportdates]![txtTo]


the form works as desired. but I want to use this frmReportdates as a subform for frmemployees, but i cant get it to work. When i click on the button it gives me an error asking for "Forms!frmReportdates!txtFrom"


any ideas? thanks!
 
Subforms require a different kind of referencing because they are in a subform control (control on the parent form which houses the subform) and they do NOT belong to the Forms collection when they are used on a parent form.

See here for a quick and easy way to get the reference you need:
http://www.btabdevelopment.com/ts/refer2sfrms
 
thanks bob!

i used Forms!frmEmployees!frmReportdates.Form.txtfrom AND Forms!frmEmployees!frmReportdates.Form.txtto

and it worked.
 

Users who are viewing this thread

Back
Top Bottom