openreport problem

richard luft

Registered User.
Local time
Today, 08:57
Joined
Jun 4, 2004
Messages
63
Hope Someone an help with the following problem. I'm trying to open a report based on tblReports, which has fields reportID, CustomerID, and txtReport. I'd like to use a dialog form to select the customer from a cboselectcustomer, and then use cmdbtn to open the report to show the customer and the txtreport (along with some other fields served by Dlookup values). Note that the primary key of tblReports is ReportID. Also, the recordsource for the report is tblreports.
Somehow, I can't seem to get the 'where' clause of my openreport macro in correct form to do what I want. Any help would be appreciated.
TIA,Richard
 
Hi Richard
Don't usually look in this area of the forum but suspect the lack of response despite 30 odd viewings is that you can't if you are using macros. Apologies if wrong on this.
What I would do is firstly make a query to support the report - call it for instance qryReports and pull in all fields from tblReports.
In the criteria row under CustomerID put [Forms]![MyFormName]![cboselectcustomer]
Then, provided you don't close the form first, your button should open up the report with the data you want.
Clearly you might have to fiddle around a bit but I think it should head you on the right track
HTH and good luck
 

Users who are viewing this thread

Back
Top Bottom