Why getting an error when click a checkbox

I am getting an error...  "Argument not optional" when I click on a checkbox to make it true.  The onclick code is:

Private Sub chkbxTranscriptionComplete_Click()

    If Me.chkbxDataComplete = True Then
       If MsgBox("An email will be sent to the assistant to let them know the data has been completed.  Do you wish to continue?", vbYesNo + vbQuestion + vbDefaultButton2) = vbYes Then
            SendEmailOutlook "somebody@somewhere.com", "Data Complete" & " - " & Me.txtFirstName & " " & Me.txtLastName, "The data has been entered for " & Me.txtFirstName & " " & Me.txtLastName & ". "
       End If
    End If

End Sub

Open in new window


And the module code to send the email is:

Public Sub SendEmailOutlook(strTo As String, strSubject As String, strBody As String, _
    strFile As String, Optional bFileAttach As Boolean = False, Optional bPreview As Boolean = False)
    
    On Error GoTo SendEmailOutlookErr
    
    Dim strEmail As String
    Dim strMsg As String
    Dim oLook As Object
    Dim oMail As Object
    
    Set oLook = CreateObject("Outlook.Application")
    Set oMail = oLook.createitem(0)
    With oMail
        '.ReplyRecipients.Add "ben@accessdatabasetutorial.com"
        .to = strTo
        '.body = sBody
        .htmlbody = strBody
        .Subject = strSubject
'        If strFile <> "" Then
'            .Attachments.Add (strFile)
'        End If
'        If bFileAttach = True Then
'            'THIS IS WHERE YOU CODE YOUR FORM TO ATTACH FILE(S)...
'            '.Attachments.Add (CurrentProject.Path & "XYZ.XXX")
'        End If
        If bPreview = True Then
            .display
        Else
            .Send
        End If
    End With
    
    If bPreview = False Then
        Set oMail = Nothing
        Set oLook = Nothing
    End If
    Exit Sub
    
SendEmailOutlookErrExit:
        Exit Sub
    
SendEmailOutlookErr:
        MsgBox Err.Description, vbOKOnly, Err.Source & ":" & Err.Number
        Resume SendEmailOutlookErrExit
End Sub

Open in new window

SteveL13Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dale FyeCommented:
Your subroutine SendEmailOutlook requires 4 arguments (strTo, strSubject, strBody, and strFile) and two optional arguments, but you only provided 3 arguments when you called the subroutine.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SteveL13Author Commented:
Thank you so much.  That did it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.