Need some assistance!!
I have a main form that has a subform that will be use to verify insurance information. I have instructed the staff once is verified to indicate in the field [Insurance Verified] "Yes".
I want for a msg box to come up when I click the close form if the field is missing the data. I put the code below at first it wasn't working because it couldn't find it. I added the word Subform in front of the form name and field. Now is telling me that an object is required. What am I doing wrong.
Private Sub Command27_Click()
On Error GoTo Err_Command27_Click
If IsNull(SubForm![Z_Authorizationform]![Insurance Verified]) Then
MsgBox "If Insurance information was verified please indicate Yes"
DoCmd.GoToControl (SubForm![Z_Authorizationform].[Insurance Verified])
DoCmd.Close
End If
Exit_Command27_Click:
Exit Sub
Err_Command27_Click:
MsgBox Err.Description
Resume Exit_Command27_Click
End Sub
I have a main form that has a subform that will be use to verify insurance information. I have instructed the staff once is verified to indicate in the field [Insurance Verified] "Yes".
I want for a msg box to come up when I click the close form if the field is missing the data. I put the code below at first it wasn't working because it couldn't find it. I added the word Subform in front of the form name and field. Now is telling me that an object is required. What am I doing wrong.
Private Sub Command27_Click()
On Error GoTo Err_Command27_Click
If IsNull(SubForm![Z_Authorizationform]![Insurance Verified]) Then
MsgBox "If Insurance information was verified please indicate Yes"
DoCmd.GoToControl (SubForm![Z_Authorizationform].[Insurance Verified])
DoCmd.Close
End If
Exit_Command27_Click:
Exit Sub
Err_Command27_Click:
MsgBox Err.Description
Resume Exit_Command27_Click
End Sub