Popup Message when accessing a Report.

vbjohn

Registered User.
Local time
Today, 03:38
Joined
Mar 22, 2002
Messages
75
I have this monster query with 13 tables. Most of them are small. I am trying to call a report from VBA and I always have something pop up and say with an input box "dbo_UPR00500MBR.EMPLOYID" and so I
enter in 1 employee number and it still comes up with everyone else that I didn't need.

strValues = " (dbo_UPR00500MBR.EMPLOYID = '" & Me!txtMNumber & "')"
DoCmd.OpenReport "YearEndStatement", acViewPreview, , strValues

How do I fix it?

John-
 
If EMPLOYID is not a text string, you need to remove the surrounding single quoted. You also don't need to use the table name. Try each of the following:

strValues = "EMPLOYID = '" & Me!txtMNumber & "'"

strValues = "EMPLOYID = " & Me!txtMNumber
 

Users who are viewing this thread

Back
Top Bottom