Querying a subform

hydeyho

Registered User.
Local time
Today, 17:24
Joined
Mar 1, 2007
Messages
31
Hi, I'm having some issues querying a sub form.

I'm using a combobox (in a subform) which supplies some search criteria. I'm using the query Like [Forms]![Employee]![Course Subform].[Form].[Combo12] & "*" but its simply not working.

Can anyone see any glaringly obvious mistakes?
 
I get the 'Enter Parameter Value' popup box as if no search criteria were supplied. I tested the subform function as a mainform (obviously droping the mainform from the query) and it works fine, just not as a subform which is why I believe there is a small problem with my query.
 
referring to controls on subforms can be problematic and depends if the name of the actual subform is the same as the name in the main form.

try this
[Forms]![Employee]![Course Subform]![Combo12]

hint
don't use default names when creating controls. Use
a) a meaningful name
b) hungarian naming convention which is basical a TLA prefix.

so for combo box's use something like cboPatientList
for text boxs txtSurname
 
referring to controls on subforms can be problematic and depends if the name of the actual subform is the same as the name in the main form.

try this
[Forms]![Employee]![Course Subform]![Combo12]

hint
don't use default names when creating controls. Use
a) a meaningful name
b) hungarian naming convention which is basical a TLA prefix.

so for combo box's use something like cboPatientList
for text boxs txtSurname

I'm still just getting the 'Enter Parameter Value' popup box :confused:
 
If you are prompted for a parameter you are not reference your contol on your subform correctly.
 
If I access the subform directly and change the query to [Forms]![Course Subform]![Combo12] it works fine, the problem only exists in the subform!
 
A subform is a type of control that you can use on a form. So it dosen't nessarly have the same name as the form does. Go into the properties of the subform and look at the name property. Or post a sample of your db.
 
Sorted, thanks KeithG, didn't realise the name of the property could be different to the name of the subform.
 

Users who are viewing this thread

Back
Top Bottom