Sending an order confirmation automatically

Andrew_w

Registered User.
Local time
Today, 11:04
Joined
Jun 24, 2008
Messages
13
Through e-mail.

Is this possible? Would I be able to somehow automatically send an email to the customer of his order confirmation through an access database?
 
The following code opens a blank email form when a user double clicks on an email address. It should be a good start toward what you want. Apply the code to the ON Close event for the form used to enter the Order. You will need to supply at least the email address, message subject and a message to the customer regarding the order.

Look up the command DoCmd.SendObject for more information about what the parameters are and how to use them.

NOTE IN ADVANCE: The last parameter controls whether the form appears for modification or whether it is sent automatically. If it is TRUE, the command displays an email form, and if it is FALSE, it sends the email.

------------------------------------------------------------------------

Private Sub Email_DblClick(Cancel As Integer)

On Error GoTo Err_Email_DblClick

Dim stDocName As String
Dim stDocSubj As String

If Me.email <> "" Then
stDocName = "Email"
stDocSubj = "Email Being Sent to " & Me.Expr1

' DoCmd.SendObject acSendNoObject, stDocName, acFormatXLS, Me.email, , , "Test Email", , True

DoCmd.SendObject acSendNoObject, stDocName, acFormatXLS, Me.email, , , stDocSubj, , True
End If
Exit_Email_DblClick:
Exit Sub

Err_Email_DblClick:
MsgBox Err.Description
Resume Exit_Email_DblClick

End Sub

------------------------------------------------------------------------
 
Nice, thanks a lot Rokie.

Clearly VB is quite powerful, would it be possible for the order confirmation to be added automatically too? So the only think they would have to do is just click on send?
 
A lot of things are possible with the DoCmd.SendObject command, but you will need to look up the syntax of the command for more information about what the parameters are and how to use them.

I know you can send a Form Letter, and I think you can send an Access Report. The latter could be used to do what you are asking.
 

Users who are viewing this thread

Back
Top Bottom