View Full Version : Help with criteria for subform


hullstorage
11-10-2008, 05:11 AM
I am trying to enter a criteria based on the JOBId to open a query

so if the job number is 258 when i click the field it then opens the query

i am fine with the commands it is just the criteria for the query

i can do this
[Forms]![Deliveries]![JOBId]

But what is the subform version is it like this because it wont work!!
[subform]![FindDeliverySubform]![JOBId]

MSAccessRookie
11-10-2008, 05:41 AM
I am trying to enter a criteria based on the JOBId to open a query

so if the job number is 258 when i click the field it then opens the query

i am fine with the commands it is just the criteria for the query

i can do this
[Forms]![Deliveries]![JOBId]

But what is the subform version is it like this because it wont work!!
[subform]![FindDeliverySubform]![JOBId]

If you are looking for the proper way to refer to a Control, then you might find this link helpful.

http://www.mvps.org/access/forms/frm0031.htm

hullstorage
11-10-2008, 06:04 AM
still cant get it to find the control

my form is called FD
my subform is call FDSubform

so is it
Forms!FD!FDSubform.Form!JOBId

or
Forms!FD!FDSubform!JOBId

MSAccessRookie
11-10-2008, 06:32 AM
still cant get it to find the control

my form is called FD
my subform is call FDSubform

so is it
Forms!FD!FDSubform.Form!JOBId

or
Forms!FD!FDSubform!JOBId

When referring to the Subform Controls using this method, the name of the CONTROL that contains the SubForm needs to be used.

Is the the name of the Control (in the main form) that contains the SubForm the same as the name of the SubForm itself? Otherwise you need to change it in the reference.

hullstorage
11-10-2008, 08:02 AM
sorry getting confused now as i am a bit new to this

i have a form called FD
within the form i have a subform call FDSubform

in the subform is the field JOBId

the subform is based on a query called QueryFindRecord
which looks up values in the form header which works fine

i just want another query to look up the value of the field JOBId in the subform so i can build another query which basically looks at all the details for the JOBId selected