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

code to set Row Source in list box 1

Status
Not open for further replies.

THWatson

Technical User
Apr 25, 2000
2,601
CA
Using Access 2000

I have an two button option group on a form. Behind each button is code to determine the Row Source for a list box.

Code:
Me.lstCustomers.RowSource = "SELECT tblCustomers.CustomerID, IIf(IsNull([Company]),[NameLast],[Company]) AS Display, tblCustomers.NameFirst FROM tblCustomers " _
& "UNION SELECT '0',"" < ALL > "","" ''"" FROM tblCustomers " _
& "ORDER BY Display, tblCustomers.NameFirst;"

The code works. The union query forces <ALL> to the top of the list. However, why does a double quotation mark " show opposite the <ALL>? And how do I fix this so that doesn't happen?

Thanks.

Tom

 
How about

Me.lstCustomers.RowSource = "SELECT tblCustomers.CustomerID, IIf(IsNull([Company]),[NameLast],[Company]) AS Display, tblCustomers.NameFirst FROM tblCustomers " _
& "UNION SELECT '0','< ALL >','' FROM tblCustomers " _
& "ORDER BY Display, tblCustomers.NameFirst;"

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Ken
Yep, that sure enough works.

I was pretty certain that I had tried the single quote marks as delimiters but perhaps not.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top