Query Def object does not have text as criteria

AshikHusein

Registered User.
Local time
Today, 08:19
Joined
Feb 7, 2003
Messages
147
Hi,

I am trying to pull a value from a combo box on a form to be used in SQL in the WHERE part. The field of the table from where the combo box pulls list for the combo box is "Text"

However, when the query is created, it gets populated into the criteria without the quotations i.e. instead of "YYA5(204)" it populates as YYA5(204) causing problems for the query to run.

Would appreciate help for the above. Thanks.
 
So the Value from the comboBox you get is "YYA5(204)" is it?
 
The value in the combo box appears as YYA5(204) but this is pulled from a table where the data is classified as Text.
 
Could you show the coding which you have used to create the QueryDef?
 
Hi, I got it!!

in the SQL statement I had to put in """" & name_of_car & """" (where name_of_car is YYA5(204) from the Combo Box.

Thanks for your willingness to help. Regards, Access is really cryptic!! but logical!!
 
And another way is to use

Chr(34) & name_of_car & Chr(34)
 

Users who are viewing this thread

Back
Top Bottom