Query problem - What is it pls?

DavidCdp1

Registered User.
Local time
Today, 06:32
Joined
Dec 13, 2004
Messages
27
Hi Everyone,

I have a query which is giving problems
on a form i have a combo box and a text box...
i have this query in the row source section of a list box..

when i run there is no result...if i change anything it is giving problems...Please help...the query is as follows:

SELECT [Consultant Table].Consultant_ID AS ConsID, [Consultant Table].Surname, [Consultant Table].First_Name, [Consultant Table].Nationality, [Consultant Table].Process_Status FROM [Consultant Table] WHERE ((( Forms!Search_Form!combo0) Like "*" & Forms!Search_Form!text2 & "*")) ORDER BY [Consultant_ID];

Thanks
DavidCdp1
 
It doesn't make any sense to be using only form fields in the where clause. Do you think that you are supplying a column name with combo0? You can't alter the structure of a query dynamically. The only thing you can do is supply a parameter value.

If you want to change the columns to be selected or the criteria, you will need to build the entire SQL string in VBA.
 

Users who are viewing this thread

Back
Top Bottom