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

ListView Syntax "Where"

Status
Not open for further replies.

sharonniles

Programmer
May 31, 2001
38
US
Hi Everyone,

I have a three phase application.
1) Get single set of data from a list box and put into a
2) listview #1 using SQL. Click on listview #1 to get
3) listview #2 using a whole lot of SQL.

Listview #2 is based not only on a database, but on information from the list box (item 1) and listview box (item 2). The last line syntax is wrong. Any help will be appreciated.

sSql = sSql & " WHERE AcAccredID = "
sSql = sSql & lstCategory.ItemData(lstCategory.ListIndex)
sSql = sSql & " AND "
sSql = sSql & " WHERE prPCode = "
sSql = sSql & lvProjects.ListItems(lvProject.Index)

Thank you,
Sharon Niles
 
Try this

sSql = sSql & "'" & lvProjects.ListItems(lvProject.Index) & "'"

The syntax is double quote single quote double quote.

Hope this helps. Anything is possible, the problem is I only have one lifetime.[thumbsup2]
 
Remove the WHERE key word from fourth row
sSql = sSql & " prPCode = "

Boban.
Don't kill a pig for one kilogram meat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top