Need help in running report, no data uploaded!!!!

G

g

Hi Experts,

First of all thank you for reading my question and most of all giving a help.

This is my problem: I have a data entry form with a button that once it
click it will run a report and will direct to an email with the report
attached. The report source is base on a query, the query has a criteria base
on one of field on the form( Example Field Name: Txt_IDNumber). So, what ever
currently entered data on the form it has to populate to the report. The
process directing and attaching the report works fine but the report doesn't
generate data.The form still active while doing the process.

My query criteria: Like [Forms]![NameOfMyForm]![Txt_IDNumber]


'Code to email and attached the report.
stDocName = "ReportName"
DoCmd.SendObject acReport, stDocName, "Snapshot Format",
"(e-mail address removed)", , , "Email Subject", "Email Context"

Thanks Again
 
J

Jae

Try to save the record first using me.refresh before you run those commands.

'Code to email and attached the report.
stDocName = "ReportName"

me.refresh
DoCmd.SendObject acReport, stDocName, "Snapshot Format",
"(e-mail address removed)", , , "Email Subject", "Email Context"
 
G

g

Thanks Jae. That works

Jae said:
Try to save the record first using me.refresh before you run those commands.

'Code to email and attached the report.
stDocName = "ReportName"

me.refresh
DoCmd.SendObject acReport, stDocName, "Snapshot Format",
"(e-mail address removed)", , , "Email Subject", "Email Context"


g said:
Hi Experts,

First of all thank you for reading my question and most of all giving a help.

This is my problem: I have a data entry form with a button that once it
click it will run a report and will direct to an email with the report
attached. The report source is base on a query, the query has a criteria base
on one of field on the form( Example Field Name: Txt_IDNumber). So, what ever
currently entered data on the form it has to populate to the report. The
process directing and attaching the report works fine but the report doesn't
generate data.The form still active while doing the process.

My query criteria: Like [Forms]![NameOfMyForm]![Txt_IDNumber]


'Code to email and attached the report.
stDocName = "ReportName"
DoCmd.SendObject acReport, stDocName, "Snapshot Format",
"(e-mail address removed)", , , "Email Subject", "Email Context"

Thanks Again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top