Email in access

G

Guest

I have a datasheet with Travelers and there travel number. I have a checkbox
when the travel has been approved. I also have each travelers email addy
attached with there name
When the check box is checked, on close I would like it to send out an email
to that traveler stateing

Pam,
Your travel to Homer on January 30, 2006 has been approved.
Have a nice trip.

I wouold like the TA Number in the subject line
I have a field for Destination-Homer, Date leave- January 30, 2006 and TA
Number-TA Number. I found

DoCmd.SendObject acSendNoObject, , , To:=, Subject:=[TA Number],
MessageText:=["Dear " & [FirstName] & ": " & vbcrlf & "Your travel to " &
[Destination] &
" on " & [Date Leave], EditMessage:=True
End Sub
When I put this in under on close I get confussed on where to intergrade the
check box.

Can someone please help me?
 
A

Arvin Meyer [MVP]

Add a condition using If ... Then, like this:

If Me.chkApproved = True Then
DoCmd.SendObject acSendNoObject, , , _
To:=, Subject:=[TA Number], _
MessageText:=["Dear " & [FirstName] & ": " & _
vbcrlf & "Your travel to " & _
[Destination] & _
" on " & [Date Leave], EditMessage:=True
End If
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
G

Guest

Private Sub Form_Close()
If Me.[Travel Approved] = True Then
DoCmd.SendObject acSendNoObject, , , To:=, Subject:=[TA Number], _
MessageText:=["Dear " & [First and Last Name] & ": " & _vbcrlf & "Your
travel to " & _[Destination] & _" on " & [Date Leave], EditMessage:=True]
End If
End Sub

It ask for an end bracket. I don't know where it goes.

[QUOTE="Arvin Meyer"]
Add a condition using If ... Then, like this:

If Me.chkApproved = True Then
DoCmd.SendObject acSendNoObject, , , _
To:=[Email], Subject:=[TA Number], _
MessageText:=["Dear " & [FirstName] & ": " & _
vbcrlf & "Your travel to " & _
[Destination] & _
" on " & [Date Leave], EditMessage:=True
End If
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

[QUOTE="Chey"]
I have a datasheet with Travelers and there travel number. I have a checkbox
when the travel has been approved. I also have each travelers email addy
attached with there name
When the check box is checked, on close I would like it to send out an email
to that traveler stateing

Pam,
Your travel to Homer on January 30, 2006 has been approved.
Have a nice trip.

I wouold like the TA Number in the subject line
I have a field for Destination-Homer, Date leave- January 30, 2006 and TA
Number-TA Number. I found

DoCmd.SendObject acSendNoObject, , , To:=[Email], Subject:=[TA Number],
MessageText:=["Dear " & [FirstName] & ": " & vbcrlf & "Your travel to " &
[Destination] &
" on " & [Date Leave], EditMessage:=True
End Sub
When I put this in under on close I get confussed on where to intergrade the
check box.

Can someone please help me?
[/QUOTE]
[/QUOTE]
 
A

Arvin Meyer [MVP]

Remove the left square bracket after the word: True.

It wasn't in my code, or your original code.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

Chey said:
Private Sub Form_Close()
If Me.[Travel Approved] = True Then
DoCmd.SendObject acSendNoObject, , , To:=, Subject:=[TA Number], _
MessageText:=["Dear " & [First and Last Name] & ": " & _vbcrlf & "Your
travel to " & _[Destination] & _" on " & [Date Leave], EditMessage:=True]
End If
End Sub

It ask for an end bracket. I don't know where it goes.

[QUOTE="Arvin Meyer"]
Add a condition using If ... Then, like this:

If Me.chkApproved = True Then
DoCmd.SendObject acSendNoObject, , , _
To:=[Email], Subject:=[TA Number], _
MessageText:=["Dear " & [FirstName] & ": " & _
vbcrlf & "Your travel to " & _
[Destination] & _
" on " & [Date Leave], EditMessage:=True
End If
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

[QUOTE="Chey"]
I have a datasheet with Travelers and there travel number. I have a checkbox
when the travel has been approved. I also have each travelers email addy
attached with there name
When the check box is checked, on close I would like it to send out an email
to that traveler stateing

Pam,
Your travel to Homer on January 30, 2006 has been approved.
Have a nice trip.

I wouold like the TA Number in the subject line
I have a field for Destination-Homer, Date leave- January 30, 2006 and TA
Number-TA Number. I found

DoCmd.SendObject acSendNoObject, , , To:=[Email], Subject:=[TA Number],
MessageText:=["Dear " & [FirstName] & ": " & vbcrlf & "Your travel to " &
[Destination] &
" on " & [Date Leave], EditMessage:=True
End Sub
When I put this in under on close I get confussed on where to[/QUOTE] intergrade
the[QUOTE]
check box.

Can someone please help me?
[/QUOTE]
[/QUOTE][/QUOTE]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top