Where Condition in Report

Dummy

Dummy User
Local time
Today, 11:36
Joined
Mar 7, 2005
Messages
25
i have a form of Employee Info, where with navigation button i move to the next employee.
i have put a Command button to Preview Report on Single Employee Info that i am reading currently.
So i want to Filter the Report with Single Employee Name and records
so im coding on click even of the command button (see below) and its giving me null report.

im using where condition to filter the report and assign to it a variable employee name from the form. Reminding that source codes of both Form and Report is the same

X = Form_frm_MainCurrent.EmployeeName.Value

stDocName = "rpt_All"

DoCmd.OpenReport stDocName, acPreview, , "EmployeeName = X"

anyone got any clue to help me out?

Thanks for your time
 
If you are running this code beneath your form you can reference the employee name text box with Me. rather than trying to assign its value to a variable.

Code:
DoCmd.OpenReport stDocName, acPreview, , "EmployeeName = '" & Me.EmployeeName & "'"
 
Thank You Sir, this is it:)
 

Users who are viewing this thread

Back
Top Bottom