Emailing Single Recored only!!

ChrisF

New member
Local time
Today, 21:29
Joined
Jun 12, 2003
Messages
8
I have created a Simple form, which when someone phones in to work sick there details are entered into a form and then Emailed to the wages department.

The button i created mails ALL the records in the table and i only want it to mail the current record to the Wages Department.

This is my code so far

************************************

Private Sub Command19_Click()
On Error GoTo Err_Command19_Click

Dim stDocName As String
Dim CN As Integer

CN = Me.CN

stDocName = "Sick"
DoCmd.SendObject acReport, stDocName, acFormatHTML, "GailW", , , "Notification of Absence From Work", "Please find attached Absence from work Notification"



Exit_Command19_Click:
Exit Sub

Err_Command19_Click:
MsgBox Err.Description
Resume Exit_Command19_Click

End Sub

************************************

Any idea on how i can get it just to mail the current onscreen details???

(Using a report in HTML format as a attathment to hold the details in the Email atm, if i could just send the details as txt in the email that would be even better)

Thanks

:confused:
 
This sample might help you. It's in Access 2000, let me know if you need it converted.
 

Attachments

Sorry I was a little bit quick off the mark with that last post, didn't see the bottom part of your post about the html attachment.

Perhaps this sample might be better for you. It's in Access 97.
 

Attachments

just had a quick look at those two samples. i think that i could use part of them to send the file,

Cheers
 
Thanks!

Thanks Hayley for your help there, I was able to use it to put an email button on my contact database. Now I just need to start working out how to email groups of people at a time!!
:D
 
No problem, glad it helped. if you have any problems I'd be more than happy to help you out.
 
Well Since You Offered...

... I've tried to teach myself bits and pieces of vba as I've developed a couple of databases but am in no way fluent! I would like to enable users of my contact management system to email a group of users from a query, i.e. all Senior Managers etc. etc. I understand that this will involve a piece of VBA that calls Outlook and then loops through the query recordset but am not sure where to start, all the examples I've seen on this forum start Outlook anew which I don't want to do.
The code you've provided on this thread only allows for one email address doesn't it?:confused:
 
The first example only allows for one email, Just made you a quick sample of emailing all contacts in a query. Is this what you're after? If not let me know.

HTH
Hay
 

Attachments

Hi Sophie

Have a look at the latest sample I posted in Lynsey's thread - think that's closer to what you're after. Let me know if you need anything else.

Thread

Hay
 

Users who are viewing this thread

Back
Top Bottom