Enter parameter value again

johannaellamay

Registered User.
Local time
Tomorrow, 04:29
Joined
Jul 19, 2014
Messages
190
I have already made this work a lot of times but for some reason, there seems to be a problem in one of my buttons.

So I have a command button that opens a report.

In one of my reports, this macro works:

Code:
="[eEmployeeID]=" & [eEmployeeID]

However, in another command button that should open another report, the code below does not seem to work:

Code:
="[echEmployeeID]=" & [eEmployeeID]

It just keeps giving me errors saying that there's a mismatch, etc. The field in my report that holds Employee ID is named echEmployeeID. If I write this code:

Code:
="[echEmployeeID]=" & "[eEmployeeID]"

it sort of works, but Access asks me to enter parameter value first before executing the where condition. I don't understand why. I already tried to change [echEmployeeID] to [eEmployeeID] both in the source table, and the report but it just doesn't work. Help please. :banghead:
 
Last edited:
The field in my report that holds Employee ID is named echEmployeeID
A report don't contain fields. Just controls. So, "echEmployee" is the name of the control in your report. So, try the same syntax as in your first code:
Code:
="[eEmployeeID]=" & [eEmployeeID]
 
A report don't contain fields. Just controls. So, "echEmployee" is the name of the control in your report. So, try the same syntax as in your first code:
Code:
="[eEmployeeID]=" & [eEmployeeID]

I did what you said. I used that code for "echEmployeeID" control in my report using:

Code:
="[eEmployeeID]=" & [eEmployeeID]

But it just tells me:

Syntax error (missing operator) in query expression '[eEmployeeID]='
 
Wew nevermind. I was able to solve it. I just tried to change the data types. It worked!
 

Users who are viewing this thread

Back
Top Bottom