Opening a general report with specific data

Lanason

Registered User.
Local time
Today, 03:23
Joined
Sep 12, 2003
Messages
258
Hi Guys and Girls,

I want to send a report to an email but I wan to do it for selected customer

I'm gunna use the SendObject to send the mail but I need to pass the data to the Report to just select to required customer

so to open the report I want to have something like:-
Dim CustomerName as string
CustomerName = "Cust1"
docmd.openreport rptReprt, AcPreview, CustomerName

to send it
Dim CustomerName as string
CustomerName = "Cust1"
DoCmd.SendObject acReport, "EmployeeReport", "SnapshotFormat(*.snp)", AddressTo, ccTo, bcTo, Subject, msgBody, False, ""

I want to have the CustomerName (viable / parameter) in the Report query so it know which customer to select

Help on the syntax would be appreciated:D
 
Last edited:
Use a form for selecting the customer (i.e from a combo box or entered into a text box) and reference this form control in your report's query. The form will need to remain open whenever you use the report, but it can be hidden if you want. If you choose to hide it, it would be a good idea to close it in your code after you send the report.
 
I want to hard encode it - rather than allow the user to choose.
 
Then put it in the criteria row of the appropriate column of your report's query.
 
maybe i wasn't clear but i want to email a customised report to a number of customers - only containing their data
 
Sounds like you want to loop through a predetermined record set and e-mail a separate report to each of those customers. If that's the case, this link and/or this link may be helpful.
 
Dear Beetle

You are a star !! Many thanks working like a dream now :D:D
 

Users who are viewing this thread

Back
Top Bottom