Automagically e-mail results of query

BubbaBBQ

Board Regular
Joined
Jan 29, 2003
Messages
68
I have a form with a "Save" button. If the Send_Call check box is checked, then part of the save process that I desire is to e-mail the contents of the form (or record, it's the same thing).

Code:
If Me.Send_Call = True Then
     DoCmd.SendObject acSendReport, "SendMail", acFormatRTF, "joe.smith@domain.com", , , "Title", "Body", 0
     End If
        
DoCmd.GoToRecord , , acNewRec
GoTo Exit_Save_Click

The report "SendMail" depends on a query which asks for the record number. How do I pass the record number (which is known by the system as Call_Num) to the query in the code above so that the user does have to enter the number manually?

Or is there another way?

Thanks,

Bubba
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,221,539
Messages
6,160,412
Members
451,644
Latest member
hglymph

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top