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!

Multi selected list for citerias in a DoCmd.OpenReport

Status
Not open for further replies.

jondion80

Programmer
Jun 21, 2002
7
0
0
CA
Hi everybody! My problem is: I'm trying to put a var (who contains some values from a multi selected list) in a DoCmd.OpenReport. Please help me! Thanks!

Dim crit As String

If (crit <> &quot;&quot;) Then
crit = crit & &quot; AND [C16-VEND]= forms!Form1![myListBox]&quot;
Else: crit = crit & &quot;&quot;&quot; [C16-VEND]= forms!Form1![myListBox]&quot;
End If


DoCmd.OpenReport &quot;report1&quot;, acViewPreview, , &quot;GetValue(crit)&quot;
 
The GetValue(crit)seems a little strange to me, but I may be wrong.

I think your statement should be something like:
crit = crit & &quot; AND [C16-VEND]= &quot; & forms!Form1![myListBox]

Also, depending on what the output of the listbox is you may or may not need a single quote around the listbox statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top