Current Record Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need help with VB coding for a command button. I'm trying to capture the
current record displayed in the form and send that record by e-mail to
someone in the company.

At my place of employment, I've developed a small program in Access to work
as a log book. It generates a number for the user. The user enters detail
information about a project. Everyone within the company has access to the
program and enters their information as the project is being worked on. I
have set up a command button that sends e-mail notification to all involved
when the user generates a new number for a project. What I need is another
command button to send another e-mail when the user adds information to the
record. I'm having trouble making MS/Access capture the current record that
had just been modified. The record is still displayed on the screen (in a
form). The codes I've tried will send the entire table in an e-mail. I
don't want the whole table, just the current record.

Can anyone help me out?

Thanks,
Donna McGoldrick
MarathonNorco Aerospace, Inc.
 
Hi,

If you build a string variable for example like:

Dim strMessage as String
strMessage = "Description1: " & Me.txtFieldName1 & vbcrlf & "Description2" &
Me.txtFieldName2

(replace with the names of the controls on the form)

Then to send the e-mail:

DoCmd.SendObject acSendNoObject, , , , , , "Current Record", strMessage

--
HTH

Mark Phillipson

Free Add-Ins at; http://mphillipson.users.btopenworld.com/
 
Back
Top