G
Guest
Hello,
I have a form with a check box, date field and comment field. When the user
fills it out and hits submit, it sends out an email. If I don't click the
check box I get an "Invalid use of null" error. I'm not sure of the proper
way to resolve this.
Here is my code:
Public Sub btnNotice_Click()
On Error GoTo Err_btnNotice_Click
Dim stApproved As Variant
Dim stComments As String
Dim stCompleteDate As String
Dim stStatusReportID As String
Dim stListCode As String
Dim stListName As Variant
If Me.Approved = True Then
stApproved = "yes"
Else
stApproved = "no"
End If
stStatusReportID = Me.StatusReportID
stListCode = Me.Parent!ListCode
stListName = Me.Parent!ListName.Column(1)
stCompleteDate = Me.DateQCComplete
stComments = Me.Description
stText = "Hello," & Chr$(13) & Chr$(13) & _
"An update has been QC'd." & Chr$(13) & Chr$(13) & _
"List Code: " & stListCode & Chr$(13) & Chr$(13) & _
"List Name: " & stListName & Chr$(13) & Chr$(13) & _
"Approved: " & stApproved & Chr$(13) & Chr$(13) & _
"Comments: " & stComments
DoCmd.SendObject , , acFormatRTF, "(e-mail address removed)", , , "QC
complete", stText, 1
DoCmd.Close
' DoCmd.Close.frm003EditListInProcess
Exit_btnNotice_Click:
Exit Sub
Err_btnNotice_Click:
MsgBox err.Description
Resume Exit_btnNotice_Click
End Sub
I'm working in MS Access 2003.
Thank you,
I have a form with a check box, date field and comment field. When the user
fills it out and hits submit, it sends out an email. If I don't click the
check box I get an "Invalid use of null" error. I'm not sure of the proper
way to resolve this.
Here is my code:
Public Sub btnNotice_Click()
On Error GoTo Err_btnNotice_Click
Dim stApproved As Variant
Dim stComments As String
Dim stCompleteDate As String
Dim stStatusReportID As String
Dim stListCode As String
Dim stListName As Variant
If Me.Approved = True Then
stApproved = "yes"
Else
stApproved = "no"
End If
stStatusReportID = Me.StatusReportID
stListCode = Me.Parent!ListCode
stListName = Me.Parent!ListName.Column(1)
stCompleteDate = Me.DateQCComplete
stComments = Me.Description
stText = "Hello," & Chr$(13) & Chr$(13) & _
"An update has been QC'd." & Chr$(13) & Chr$(13) & _
"List Code: " & stListCode & Chr$(13) & Chr$(13) & _
"List Name: " & stListName & Chr$(13) & Chr$(13) & _
"Approved: " & stApproved & Chr$(13) & Chr$(13) & _
"Comments: " & stComments
DoCmd.SendObject , , acFormatRTF, "(e-mail address removed)", , , "QC
complete", stText, 1
DoCmd.Close
' DoCmd.Close.frm003EditListInProcess
Exit_btnNotice_Click:
Exit Sub
Err_btnNotice_Click:
MsgBox err.Description
Resume Exit_btnNotice_Click
End Sub
I'm working in MS Access 2003.
Thank you,