I have been trying to use user entered selections on a form to pick the data printed on a report. As far as I can see I have followed the help files and help given to 2 previous threads in this forum but am still having problems.
my code:
WhereCrit = "T_BookHrs.UserID= " & Forms!F_BookHrs!UserID_TB
stDocName = "R_BookedHrs"
DoCmd.OpenReport stDocName, acViewPreview,,WhereCrit
In the Watches window I get WhereCrit = "T_BookHrs.UserID=321839" which I think looks fine
But when the report opens it still asks me for the UserID and even when I do enter the UserID it seems to ignore it and I get a report with data from all users.
Any suggestions appreciated, John
my code:
WhereCrit = "T_BookHrs.UserID= " & Forms!F_BookHrs!UserID_TB
stDocName = "R_BookedHrs"
DoCmd.OpenReport stDocName, acViewPreview,,WhereCrit
In the Watches window I get WhereCrit = "T_BookHrs.UserID=321839" which I think looks fine
But when the report opens it still asks me for the UserID and even when I do enter the UserID it seems to ignore it and I get a report with data from all users.
Any suggestions appreciated, John