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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending chosen report from a list of reports to chosen multiple users

Status
Not open for further replies.

kavya

Programmer
Feb 21, 2001
83
US
I have a form which has a command button 'send email' and contains the code needed to send email with report as an attachment (rtf format), to a list of chosen people by the database user.
the process goes on this way.
First the user chooses the list of users the email has to be sent, the list of chosen users is collected into a table which stands as a source for the recordset for the send object command listing the names of the persons the email to be sent and then after choosing the list of email recepients the user gets to another form where he or she hits the command button 'send email' and the email is sent.
Until here everything is fine.

I am trying to create a way the user can even choose what report to be sent from a list of reports, same as he or she chooses the email recepents.
Hope I am trying to explain myself in a clear manner.
Could somebody suggest me anyway to tackle the whole problem.

I tried to create another form with a combo box where the user can choose as to which report to email.I was trying to collect the chosen option into a table called 'Report Chosen'
the problem is each time after a process is made( like choosing a specific report, choosing the email recipients and then clicking the send email button,) Next time when the user selects to choose another report,the records in the table 'reports chosen' should be deleted so as to hold data for a single process.

Please advise me on this.

Thanks a million in advance.
Regards

 
have you tried this instead of making/appending ReportName into a table?

in code do something like (substituting your forms/cbo box names):

dim strReportName
strReportName = forms!ReportChoiceForm!cboReportChoice

then in sendobject code make substitute the above strReportName

g
 
The way I would do it is 2 list boxes
one with its source set to list the possible people to send to the other with its source set to list the avaliable reports
then using vba loop thru the selected items and via sendobject method send out the reports. This will give you several options. You can send several reports to several users, Several reports to one user or one report to several users.
You would need to code it to limit choices and some of the loops could be a bit tricky but should not be much of a problem.

 
i thought you could only send one report at a time with SendObject?
 
if you loop then you can send several

something like this

dim rptitem as variant
dim nameitem as variant
dim rptname as string
dim rptto as string
for each nameitem in yournamebox.itemsselected 'loop names
rptto = nameitem
for each rptitem in yourrptbox.itemsselected 'loop reports
rptname = rptitem 'if not firstcolumn use
'lets send the report
docmd.sendobject acsendreport, selitem,acformatrtf,rptto,,,false
next selitem 'get nextreport
next nameitem 'get next name


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top