View Full Version : Report based on field in a Form/Subform


3dCubed
10-13-2000, 07:53 AM
I am attempting to have a report print based on a number in a text field in a sub-form. I have a button in the sub-form that opens the report in preview. The report is based on a query. I have attempted to put in the query criteria =[forms]![mainformname]![subformname]![txtfieldname].

When I execute the command by clicking on the print button in the sub form I get a dialog box asking for the value for forms.mainformname.subformname.txtfieldname and if I enter the value from the field the result of the query is correct and the report only shows that record.

If I use a field from the mainform the syntex works. That is if I use [forms]![mainformname]![txtfieldname] it works. I have also tried the syntex [forms]![subformname]![txtfieldname] but it also pops up a dialog box to enter the value for forms.subformname.txtfieldname.

I am running Access 2000. Is their a problem making a reference to a subform field in Access 2000?


I have researched this for 3 days, checked technet, and can not seem to know where to go next. Thanks to anyone who has run into this.

My email address if you want to discuss off line is madkins@vba.va.gov


Michael Adkins

Travis
10-13-2000, 10:16 AM
Try this

=[forms]![mainformname]![subformname].Form![txtfieldname]