sending form via email

  • Thread starter Thread starter Daniel M
  • Start date Start date
D

Daniel M

I have a form with a submit button. This button currently writes the form
data to a table, now i want to add the functionality to email a short
message that ticket #xxx was created where the ticket# comes from the form.

Could someone help me get this done? I can send a table but i cant figure
out how to send a form or put in the data in the message body. alternately i
could just send a screenshot of the form.

thanks.
daniel.
 
Daniel,
You cannot send a Form, you can send a report though in various formats, try
right clicking your mouse over the form name you want to create a report for
and select save as report,
Then create a macro and select "sendObject", select the name of this report
and send in the format you wish, like snapshot, in the subject heading you
could fill in =[Forms]![tblName]![ticket#field], this will then call up the
ticket number for that particular report.
Name the macro something like emailmacro and refer to it on the on-click
event of a command button on your form.
 
Chris,

Thanks, this procedure works well. the only thing i cannot figure out now is
how to change the =[Forms]![tblName]![ticket#field] subject line to work
right. I have it inserting the ticket number but i would like to be able to
insert some text as well. IE: "Ticket number xxx is now ready for review"

thanks.

Chris B via AccessMonster.com said:
Daniel,
You cannot send a Form, you can send a report though in various formats,
try
right clicking your mouse over the form name you want to create a report
for
and select save as report,
Then create a macro and select "sendObject", select the name of this
report
and send in the format you wish, like snapshot, in the subject heading you
could fill in =[Forms]![tblName]![ticket#field], this will then call up
the
ticket number for that particular report.
Name the macro something like emailmacro and refer to it on the on-click
event of a command button on your form.

Daniel said:
I have a form with a submit button. This button currently writes the form
data to a table, now i want to add the functionality to email a short
message that ticket #xxx was created where the ticket# comes from the
form.

Could someone help me get this done? I can send a table but i cant figure
out how to send a form or put in the data in the message body. alternately
i
could just send a screenshot of the form.

thanks.
daniel.
 
Hi Daniel,
You can try this:
="Ticket#"& " " &[Forms]![tblName]![ticket#field]&" "&"is now ready for
review"
Let me know how it goes
Chris

Daniel said:
Chris,

Thanks, this procedure works well. the only thing i cannot figure out now is
how to change the =[Forms]![tblName]![ticket#field] subject line to work
right. I have it inserting the ticket number but i would like to be able to
insert some text as well. IE: "Ticket number xxx is now ready for review"

thanks.
Daniel,
You cannot send a Form, you can send a report though in various formats,
[quoted text clipped - 23 lines]
 
Sorry, this is what you had asked for - I had used a # instead of the word
Number....

="Ticket Number"& " " &[Forms]![tblName]![ticket#field]&" "&"is now ready for
review"


Chris said:
Hi Daniel,
You can try this:
="Ticket#"& " " &[Forms]![tblName]![ticket#field]&" "&"is now ready for
review"
Let me know how it goes
Chris
[quoted text clipped - 10 lines]
 
Chris,

This works a little bit better, the only problem now is since i changed the
button to run a macro it now never runs my vb code. can i call the macro
from the vb code? or vise versa? i am just submitting the data to a table
and refreshing the form. Thanks.

Chris B via AccessMonster.com said:
Sorry, this is what you had asked for - I had used a # instead of the word
Number....

="Ticket Number"& " " &[Forms]![tblName]![ticket#field]&" "&"is now ready
for
review"


Chris said:
Hi Daniel,
You can try this:
="Ticket#"& " " &[Forms]![tblName]![ticket#field]&" "&"is now ready for
review"
Let me know how it goes
Chris
[quoted text clipped - 10 lines]
thanks.
daniel.
 
Daniel,
Im still very new at this but im sure you can call the macro in VBA with
DoCmd.RunMacro "MacroName"
Chris


Daniel said:
Chris,

This works a little bit better, the only problem now is since i changed the
button to run a macro it now never runs my vb code. can i call the macro
from the vb code? or vise versa? i am just submitting the data to a table
and refreshing the form. Thanks.
Sorry, this is what you had asked for - I had used a # instead of the word
Number....
[quoted text clipped - 15 lines]
 
Ok now i'm back to the start. I was able to call the macro from VB and have
saved the form as a report but now whenever i generate the email it creates
and email with every record in it, not just the single record.

=[Forms]![request]![rma_number]

how do i specify a single record?


Chris B via AccessMonster.com said:
Daniel,
Im still very new at this but im sure you can call the macro in VBA with
DoCmd.RunMacro "MacroName"
Chris


Daniel said:
Chris,

This works a little bit better, the only problem now is since i changed
the
button to run a macro it now never runs my vb code. can i call the macro
from the vb code? or vise versa? i am just submitting the data to a table
and refreshing the form. Thanks.
Sorry, this is what you had asked for - I had used a # instead of the
word
Number....
[quoted text clipped - 15 lines]
thanks.
daniel.
 
Daniel, applogies for the two steps forward, three steps back scenario!!
Its always a little tricky trying to fix something you cant see

You now need a query to filter to current open record only -
Create a query in design view, click on the table where the [rma_number] lies.

1)In the first column - Field place the * referance field, Table should be
automatically filled in, Tick/check the Show box.
2)In the second column - Field Place the [rma_number], table field should be
filled in automatically, UNCHECK / UNTICK the SHOW BOX, THEN in Criteria type
in exactly [Forms]![request]![rma_number] NOTE NO = Signs
Save the query as anything you want.
Go to the report in question and on RECORD SOURCE refer to this query you
just made.
This then should filter the report to the record which is currently open on
your screen.

If you want , zip your database and send to me and I'll try my best to help
you butborisatyahoodotcom
Replace "at" with@ and "dot " with .

Chris

I
Daniel said:
Ok now i'm back to the start. I was able to call the macro from VB and have
saved the form as a report but now whenever i generate the email it creates
and email with every record in it, not just the single record.

=[Forms]![request]![rma_number]

how do i specify a single record?
Daniel,
Im still very new at this but im sure you can call the macro in VBA with
[quoted text clipped - 15 lines]
 
Back
Top