Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenReport,, where.. is not working

Status
Not open for further replies.

johnbucks

Technical User
Apr 27, 2004
9
DE
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
 
WhereCrit = "UserID= " & Forms!F_BookHrs!UserID_TB

________________________________________
Zameer Abdulla
Visit Me
There is only one perfect child in this world. Every mother has it.
 
I just tried this change but I still get the same.

After pressing my report button a pop-up appears asking me to enter the parameter value UserID.
Even if I enter a value the form opens with all users data displayed.

If I enter the userID as a criteria in the Query that the form is based upon then it works fine.. i only get the data for the single user in the report.

John
 
I may have just solved the problem - i had the field that I was trying to filter by selected to be not shown.

Now that I "show" this data in the query the WhereCrit seems to work.

Thanks for your help anyway

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top