notify by email?

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

I have written a database that workers can update a
maintenance log weekly, but I would like to give them a
button to click on that would send a notification email to
their supervisor that the weekly maintenance log has been
updated so he can print the weekly report. Any ideas?

office 2002

Thanks,

Dan
 
How about the SendObject method? It's fairly simple and could work
something like the following:

Dim strMsg as String

strMsg = "The Maintenance Log has been updated."

DoCmd.SendObject acSendNoObject, , , "(e-mail address removed)", , ,
"Maintenance Log", strMsg


hth,
 
Thanks Cheryl! Would it be easier to just send the
report? What format would it send the file?

Dan
-----Original Message-----
How about the SendObject method? It's fairly simple and could work
something like the following:

Dim strMsg as String

strMsg = "The Maintenance Log has been updated."

DoCmd.SendObject
acSendNoObject, , , "(e-mail address removed)", , ,
 
Well, the available formats in SendObject are:

acFormatDAP
acFormatHTML
acFormatRTF
acFormatTXT
acFormatXLS

I believe that there is also a Snapshot format: acFormatSNP that was left
out of the Help file.

The appropriate ones for sending an Access report would likely be: RTF
(opens with Word), TXT, SNP (requires the Snapshot viewer) or maybe XLS.
If your report is nicely formatted, you probably are not going to like any
of the formats.
 
Thanks Cheryl, but I cannot get it to work. Here is my
code.

Private Sub cmdSend_Click()
Dim strMsg As String
strMsg = "Maintenance log has been updated"
DoCmd.SendObject acSendReport, rptsignallightmaint2,
acFormatRTF, "(e-mail address removed)", , , _
"Weekly Report", "Weekly report is attached.", , ,
strMsg

End Sub
 
Put the report name in quotes and delete everything after "Weekly report is
attached".
 
That worked like a champ Cheryl! Thanks! I do have one
last question. (hehe) The RTF works fine, but for giggles
I tried the xls for excel and it said "The format in which
you are attempting to output the current object is not
available." What gives? I have Excel on this workstation.

Troy
 
ah crap, I know what I forgot now. Is it possible to
change the file name that it sends? Just curious. I
noticed it's not named anything like it should be.

Thanks,

Dan
 
I don't see an argument in help on SendObject for naming the file, so I
would say no you cannot specify a name.
 
Back
Top