I have created a button with code attached to send email to users when they have been set up on our system but everytime I run the code I get an eror message.
Compile error
Argument not optional
and the word Post is highlighted
here is my code.
Private Sub Command108_Click()
On Error GoTo Err_Command108_Click
Dim SendTo As String, MySubject As String, MyMessage As String
SendTo = Recepirnt[EMAIL="Recepirnt@hotmail.com"]@hotmail.com[/EMAIL]
MySubject = Me.Fname & " " & Me.Sname
MyMessage = " I have set up " & Fname & " " & Sname & " on lid no " & Uname & " password is x" & vbCtrLf & vbCrLf & "She is " & Post & " Based at " & Section
DoCmd.SendObject acSendNoObject, , , SendTo, , , MySubject, MyMessage, True
Exit_Command108_Click:
Exit Sub
Err_Command108_Click:
MsgBox Err.Description
Resume Exit_Command108_Click
End Sub
PLEASE PLEASE HELP
Compile error
Argument not optional
and the word Post is highlighted
here is my code.
Private Sub Command108_Click()
On Error GoTo Err_Command108_Click
Dim SendTo As String, MySubject As String, MyMessage As String
SendTo = Recepirnt[EMAIL="Recepirnt@hotmail.com"]@hotmail.com[/EMAIL]
MySubject = Me.Fname & " " & Me.Sname
MyMessage = " I have set up " & Fname & " " & Sname & " on lid no " & Uname & " password is x" & vbCtrLf & vbCrLf & "She is " & Post & " Based at " & Section
DoCmd.SendObject acSendNoObject, , , SendTo, , , MySubject, MyMessage, True
Exit_Command108_Click:
Exit Sub
Err_Command108_Click:
MsgBox Err.Description
Resume Exit_Command108_Click
End Sub
PLEASE PLEASE HELP