Re: Multi select list boxes to generate query from form
- From: "Douglas J. Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxxx>
- Date: Sat, 29 Apr 2006 17:21:27 -0400
Check http://www.mvps.org/access/forms/frm0007.htm at "The Access Web" for
one approach, although to be honest I prefer to use:
strSQL = "Select * from Employees where [EmpID] In ("
For Each varItem In ctl.ItemsSelected
strSQL = strSQL & ctl.ItemData(varItem) & ", "
Next varItem
strSQL=Left$(strSQL,len(strSQL)-2)) & ")"
Note that if the field is text, you need to include quotes around the value.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"SusanForson" <SusanForson@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CB0C1D48-F814-48CB-BAF8-E4771BD5A0D2@xxxxxxxxxxxxxxxx
I successfully set up a form to use two multi-select list boxes to generate
a
report using the Northwind example posted for previous inquiries. I would
also like to be able to preserve the query generated in this process so I
can
export the query to Excel (or just generate the query and not the report).
I tried setting up a query to read the form, but am not getting the
criteria
set up correctly to read multiple choices.
Any suggestions? I need help with writing the code.
.
- Prev by Date: Re: Insert records in Parent and child tables
- Next by Date: Re: Selecting different tables
- Previous by thread: Re: Need Aggregate Query Help!!!
- Next by thread: Using AND or OR on subtable
- Index(es):
Relevant Pages
|
|