Filter Query Based on Form Field

kobiashi

Registered User.
Local time
Today, 20:41
Joined
May 11, 2018
Messages
258
H

I am trying to filter a query i have set up in a combo box, based on a form field.

so the table is

Vehicle_ID | VehicleNumber | VehicleType
1 | V001 | B92
2 | V002 | B92
3 | V123 | B2007

on the form there is 4 combo boxes - form name (NewMCUTracker)

VehicleAtFault
Vehicle1
Vehicle2
Vehicle3
VehicleType

what i am trying to do is, filter Vehicle1, Vehicle2, Vehicle3, based on VehicleAtFault selection

i thought i could filter the query in the combo box by adding VehicleType to the query and inserting in the criteria
Code:
[forms]![NewMCUTracker]![VehicleType]

but it doesnt work

is there something im doing wrong
 
Last edited:
Use the Builder in the Query designer to get the correct syntax. That allows you to select the form and control and so produces the correct syntax.



H

I am trying to filter a query i have set up in a combo box, based on a form field.

so the table is

Vehicle_ID | VehicleNumber | VehicleType
1 | V001 | B92
2 | V002 | B92
3 | V123 | B2007

on the form there is 4 combo boxes - form name (NewMCUTracker)

VehicleAtFault
Vehicle1
Vehicle2
Vehicle3
VehicleType

what i am trying to do is, filter Vehicle1, Vehicle2, Vehicle3, based on VehicleAtFault selection

i thought i could filter the query in the combo box by adding VehicleType to the query and inserting in the criteria
Code:
[form]![NewMCUTracker]![VehicleType]
but it doesnt work

is there something im doing wrong
 
Apologies, that was a misspell i have changed it.
 

Users who are viewing this thread

Back
Top Bottom