Good afternoon,
I want to use a variable (text) to complete an email but I cannot manage to insert the variable value in the email text message.
In the example here below I have 2 string variables : VehicleType and VehicleVin. I would like to use these information to update the text in my email message that should become "Vehicle profile"& VehicleType. But I cannot make it work
Private Sub CmdVehicleProfileEMail_Click()
On Error GoTo CmdVehicleProfileEmail_Click_Err
Dim VehicleNumber As Integer
Dim VehicleType As String
Dim VehicleVin As String
VehicleNumber = [TFleetRef]
DoCmd.OpenForm "FQTVehicleProfileEMail", acNormal
DoCmd.ApplyFilter "", "TFleetRef=" & VehicleNumber
DoCmd.SendObject acForm, "FQTVehicleProfileEMail", "PDFFormat(*.pdf)", "", "", "", "Profile vehicle"
DoCmd.Close
CmdVehicleProfileEMail_Click_Exit:
Exit Sub
CmdVehicleProfileEmail_Click_Err:
MsgBox "Your e-mail has not been sent"
DoCmd.Close acForm, "FQTVehicleProfileEMail"
DoCmd.Close acForm, "FQTVehicleProfile"
Resume CmdVehicleProfileEMail_Click_Exit
End Sub
Can somebody help it ?
Thanks and regards