DoCmd.OpenReport (from combobox)

Access_Help

Registered User.
Local time
Yesterday, 20:27
Joined
Feb 12, 2005
Messages
136
DoCmd.OpenReport sRpt, acPreview, , "[First_Name]= '" & List13.Column(1) & "'" And [Progress] = "Me.[Combo26]"

Can someone please help me fix the syntax error in this line.

I have a form with a listbox and a combo.

I have added the second search criteria And [Progress] = "Me.[Combo26]",

I am recieving a run time error 2465 - can't find the field '1' referred in your expression.

The first search criteria from the listbox works fine.

Thanks in advance.
 
I am guessing there is no field called Progress in your report. Fields are zero based.
 
You haven't concatenated the string correctly, try this; (I've assumed Progress is a text field, if not remove the additional ' ' around combo26 value).

Code:
Dim sWhere as String

sWhere =  "[First_Name]= '" & List13.Column(1) & "' And [Progress] = '" & Me.[Combo26] & "'"

Debug.Print sWhere

DoCmd.OpenReport sRpt, acPreview, , sWhere
 
Last edited:

Users who are viewing this thread

Back
Top Bottom