I have tried implementing this code and it is still giving me errors. Here's the code I'm using:
Private Function checkFields() As String
If IsNull(Me.ContactFirstName) Then
checkFields = addToString(checkFields, "First Name")
End If
If IsNull(Me.ContactLastName) Then
checkFields = addToString(checkFields, "Last Name")
End If
If IsNull(Me.Previous_Address) Then
checkFields = addToString(checkFields, "Previous Address")
End If
If IsNull(Me.Text26) Then
checkFields = addToString(checkFields, "City")
End If
If IsNull(Me.Text28) Then
checkFields = addToString(checkFields, "State")
End If
If IsNull(Me.Text30) Then
checkFields = addToString(checkFields, "ZIP")
End If
If IsNull(Me.DOB) Then
checkFields = addToString(checkFields, "Date of Birth")
End If
If IsNull(Me.SSN) Then
checkFields = addToString(checkFields, "SSN")
End If
If IsNull(Me.DL__) Then
checkFields = addToString(checkFields, "Driver License Number")
End If
If IsNull(Me.Text42) Then
checkFields = addToString(checkFields, "Building Number")
End If
If IsNull(Me.Text44) Then
checkFields = addToString(checkFields, "Unit Number")
End If
If IsNull(Me.Lease_Start_Date) Then
checkFields = addToString(checkFields, "Lease Start Date")
End If
If IsNull(Me.Lease_End_Date) Then
checkFields = addToString(checkFields, "Lease End Date")
End If
If IsNull(Me.Deposit) Then
checkFields = addToString(checkFields, "Security Deposit")
End If
If IsNull(Me.MonthlyRent) Then
checkFields = addToString(checkFields, "Monthly Rent")
End If
End Function
Private Function addToString(strOrig As String, strToAdd As String) As String
If strOrig = "" Then
addToString = strToAdd
Else
addToString = strOrig & ", " & strToAdd
End If
End Function
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click
DoCmd.Close
Exit_cmdClose_Click:
Exit Sub
Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click
End Sub
When I try to close the window without entering any data, I get this error: The Expression On Click you entered as the event property setting produced the following error: Procedure declaration does not match description of event of procedure having the same name.
What am I doing wrong? And what does this error mean?
Thanks!
David Somers