View Full Version : Subforms Accessing Values


keybs
08-16-2001, 01:23 PM
Here is my problem:
I have an update query that updates a table based on a value in a text box that is in a sub-form. The info is not successfully going from the subform to the "update to" part of the Query . I get prompted to enter the query search criteria since the value is not successfully passed to the query. I know that a subform is a control and I am almost certain that I am using the right syntax in the "Update to" field:
forms!formname!subformname.form!subformfieldname

Please help!

[This message has been edited by keybs (edited 08-16-2001).]

[This message has been edited by keybs (edited 08-16-2001).]

[This message has been edited by keybs (edited 08-16-2001).]

jwindon
08-16-2001, 04:35 PM
I guess I have a habit of going whatever route to get the job done, so my reply may be the long way around.

I would try creating a "dummy" control on the form, not visiable. I would then use the SetValue command and use the "dummy control" value as my criteria in the query.

Might be a long way around, but it might work.

keybs
08-17-2001, 05:39 AM
Got it to work now... Thanks so much for your help!!

Fornatian
08-17-2001, 05:56 AM
A tip on how to ensure the syntax is correct is to have the form you want to reference open, open the query and right click in the criteria row, choose build and use the expression builder to successfully reference the field without mistakes.

Ian