Where Clause Problem

Shaft

Registered User.
Local time
Today, 17:56
Joined
May 25, 2005
Messages
51
Can somebody tell why this piece of code doen't work. When i run it comes up with a parameter dialog box with the parameter name as Forms("Switchboard").txtEngineer when I want that to be the the parameter value. If I enter the value of Forms("Switchboard").txtEngineer as the parameter value it works fine.


stDocName = "Scores"
stLinkCriteria = "[Engineer] = " & Forms("Switchboard").txtEngineer
DoCmd.OpenForm stDocName, , , stLinkCriteria
 
Code:
"[Engineer] = """ & Forms("Switchboard").txtEngineer & """"

txtEngineer is not a number so you need to use string delimiters
 

Users who are viewing this thread

Back
Top Bottom