URGENT:whats wrong with ths code??

maya

Registered User.
Local time
Today, 10:19
Joined
Jun 11, 2003
Messages
139
Criteria = ""
For Each i In Me!Combo18.ItemsSelected
Criteria = Criteria & " Or "
Criteria = Criteria & "[Machine Name]='" & Me.Combo18.ItemData(i)
Next i
DoCmd.OpenReport strDocname, acPreview, , Criteria


im using ths code to multiselect frm a listbox into one report but am having errors...pls help...thanx
 
Try this

Criteria = Criteria & "[Machine Name]='" & Me.Combo18.ItemData(i) & "'"


What do the error messages you are getting say?



:D
 
run-time error '3075':

Syntax error (missing operator) in query expression '(Or [Machine Name]='PQFP_WBH063' Or [Machine Name]='PQFP_WBH209')'.

pls help...thanx
 
Example

could u give me an example?Thanx
 
error

i put this:
Criteria = Criteria & "[Machine Name] ='" & Me.Combo18.ItemData(i) & "' " Or " "

and im having a type mismatch error........
 
Try This

Criteria = Criteria & "[Machine Name] ='" & Me.Combo18.ItemData(i) & "' Or "
 

Users who are viewing this thread

Back
Top Bottom