Filter Query Based on Form Field (1 Viewer)

kobiashi

Registered User.
Local time
Today, 22:56
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:

Gasman

Enthusiastic Amateur
Local time
Today, 22:56
Joined
Sep 21, 2011
Messages
14,238
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
 

kobiashi

Registered User.
Local time
Today, 22:56
Joined
May 11, 2018
Messages
258
Apologies, that was a misspell i have changed it.
 

Users who are viewing this thread

Top Bottom