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!

Help open report criteria

Status
Not open for further replies.

angiem

MIS
Sep 29, 2000
116
0
0
CA
I want to open a report using the name from a listbox.

I am using access 2000.

This is the code, and I can't get it to work, the error message is about the MS jet engine.
DoCmd.OpenReport stDocName, acPreview, , "[empname]=[Forms]![AIYearForm]![lstName]"

I've also tried and get missing operator message
DoCmd.OpenReport stDocName, acPreview, , "[empname]=" & Me.lstName

Help what am I doing wrong.
 
if 1stname is a text field try

DoCmd.OpenReport stDocName, acPreview, , "[empname]=" & "'"& Me.lstName & "'"

Hope this works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top