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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSL select qrys with VB controls parameters problems with syntax ?

Status
Not open for further replies.

ringobingo

Technical User
Aug 23, 2000
2
0
0
GB
Hi,
Kind of new at this so here goes, i have these list box's filled with only distinct values from colums in an access database. These Distinct values are from a simple Select Distinct qry. I have then created a
Select qry like below so user can pull what the want from a VB form

sExecutestring = "Select * From Carsdb"
"Where FirstColumn = '"ListBox.List(Listbox.ListIndex) & "'" "And SecondColumn = '"ListBox1.List(Listbox1.ListIndex) = SecondColumn & "'" etc

I have a few questions that i would be greatful for their answers, - Can i use these two select queries in this way?
and what is the correct syntax for the Where section.

As it stands i have this query set, that looks cool in all the text and material gathered but i still get this Error

Run Time Error --2147217900
Syntax Error in From Clause

Cheers

Andy
 
1. You can save yourself a little trouble by including a space in the
text itself where possible, rather adding another & " ". For instance,
& " And secondcolumn...
2. While you're developing, a msgbox("sExecuteString = " & sExecuteString)
will give you something you can type directly into an access query, and let
access help you find/solve the errors.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top