Multiselect listbox used in Access2000

  • Thread starter Lee Stafford via AccessMonster.com
  • Start date
L

Lee Stafford via AccessMonster.com

I have a form that needs to utilize TWO different multiselect listboxes. I
have found several different forms of code to dynamically create the SQL,
but I am unfamiliar with how I would change the code to use two different
listboxes. Can anyone help me with this? ps I am a novice when it comes
to VBA

TIA,

Lee Stafford
 
J

JohnFol

Does the criteria of the query depend upon the values selected in the list
box, or does the contents of the listboxes depend upon the query?
 
A

Allen Browne

Typically you would combine the values in the WHERE clause of the SQL string

You will end up with something like this:

strSQL = "SELECT * FROM Table1 WHERE ([Field1] IN (1,3,5)) AND ([Field2] IN
('a', 'c', 'e'));"
 
Top