Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO STATEMENT DOES NOT QUERY TEXT 1

Status
Not open for further replies.

compucop

Technical User
Sep 24, 2002
107
US
I AM TRYING TO QUERY IN AN ADO STATEMENT ON A TEXT FIELD, I AM ABLE TO QUERY ON A NUMBER FIELD WITH THE BELOW STATEMENT WITH NO PROBLEM. IS THERE A WAY TO QUERY ON TEXT. BELOW IS MY STATEMENT

LIST0.ROWSOURCE = "SELECT * FROM TABLE1 WHERE NUMBER ="&ME.TEXT0.VALUE

**THIS WORKS GREAT FOR A NUMBERED FIELD, BUT I GET NO RESULTS WHEN I QUERY ON A TEXT FIELD. ANY HELP IS GREATLY APPRECIATED.
 
Compucop,

I think your problem has to do with the data type of your field Number in your table Table1. If the field has a data type of number then your statement is looking for:
...WHERE Number=7...

If your field Number is a text field then your statement is looking for:
...WHERE Number ="7"...

Judie
 
TRIED IT, IT DEFINITELY IS A SYNTAX ERROR, BUT I CAN'T SEEM TO FIGURE IT OUT. STILL TRYING. THANKS.
 
I am not familiar with ADO, but from somewhere in the depths I seem to remember that if the field is not numeric you need to add a single quote:
LIST0.ROWSOURCE = "SELECT * FROM TABLE1 WHERE NUMBER ='"&ME.TEXT0.VALUE

Not 100% though but might be worth a try Nigel
Didn't someone say work is supposed to be fun? They didn't have computers then I guess....
 
Try this

LIST0.ROWSOURCE ="SELECT * FROM TABLE1 WHERE NUMBER ='"& ME.TEXT0.VALUE & "'"
 
ESSNRV, THAT'S IT...... THANKS A MILLION. TAKE CARE..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top