J
Jared
I have a database that tracks service information for vehicles.
A vehicle can be put into a group, typically by depot.
On the dashboard of the program I have a combo box that lists all of the
vehicle groups ie Depot1, Depot2 etc.
When a user picks a vehicle from a dropdown on the service screen, I only
want them to see the vehicles grouped in the depot that has been selected on
the dashboard.
I can get this to work fine by adding the combobox on the dashboard to the
query criteria of the services vehicle combo box.
However, I'd like the user to be able select "all" or "any". The trouble I'm
having is in the criteria of the query to select all:
SELECT vehicle.vehicle_ID, vehicle.registration, vehicle.vehicle_group
FROM vehicle
WHERE
(((vehicle.vehicle_group)=IIf([Forms]![frmMain]![user_group]="_ALL",(vehicle.vehicle_group) Like "*",[Forms]![frmMain]![user_group])));
I can get Like * to work on its own but not as part of the if statement.
Any help would be greatly appreciated. Thankyou
A vehicle can be put into a group, typically by depot.
On the dashboard of the program I have a combo box that lists all of the
vehicle groups ie Depot1, Depot2 etc.
When a user picks a vehicle from a dropdown on the service screen, I only
want them to see the vehicles grouped in the depot that has been selected on
the dashboard.
I can get this to work fine by adding the combobox on the dashboard to the
query criteria of the services vehicle combo box.
However, I'd like the user to be able select "all" or "any". The trouble I'm
having is in the criteria of the query to select all:
SELECT vehicle.vehicle_ID, vehicle.registration, vehicle.vehicle_group
FROM vehicle
WHERE
(((vehicle.vehicle_group)=IIf([Forms]![frmMain]![user_group]="_ALL",(vehicle.vehicle_group) Like "*",[Forms]![frmMain]![user_group])));
I can get Like * to work on its own but not as part of the if statement.
Any help would be greatly appreciated. Thankyou