View Full Version : Form filtering - SQL help needed


Rik_StHelens
12-07-2009, 12:47 AM
Hi

I have a form that I am using to filter possible parameters for a query.

I have 3 unbound combo boxes in the following order:

1. SELECT DISTINCT [tblFleet].[Customer] FROM tblFleet WHERE [Customer]>""

(allows the user to select a customer who is NOT just a tyre dealer - hence the distinct statement)

2. SELECT tblFleet.FleetName WHERE tblFleet.Customer = Forms!Form1!Combo22

(should show all fleets belonging to a customer, based on the previous combo box value)

3. Select tblVehicle.RegistrationNumber WHERE tblVehicle.FleetName = Forms!Form1!Combo2

(allows the user to select a registration number based on the previous combo box value)


At the moment this is just a test to make sure that i can get it working, so i have not used names for form objects etc other than the standard ones given.

The first combo box displays a list of customers, however, the second combo box says "the record source '~sq_cForm1_~sq_cCombo2' does not exist on this form or report.

Is there something wrong with my SQL or is it the way I am going about filtering possible parameters

Many Thanks

Rik_StHelens
12-07-2009, 01:05 AM
Never mind

I have gone about it in a different way!

Although if anyone has any advice in case i try this method in the future then please do post a reply!

Thanks