I have a button on a form that, when pressed, is checking the data entry done on the form by the user. I'm using If..Then statements. I need to include in all this a way to check each record of the subform as well for any conflicts. I am unsure how to include a loop inside of the If..Then statements. Can anyone give me some direction? Here is some simplified code:
Private Sub cmdCloseCO_Click()
On Error GoTo Err_cmdCloseCO_Click
Dim StrMsg As String
StrMsg = "The check out information has been changed."
StrMsg = StrMsg & " Do you want to save the changes?"
If MsgBox(StrMsg, vbYesNo, "") = vbNo Then
[Commands]
Else
If IsNull(Me.DateOut) Then
[Commands]
ElseIf IsNull(Me.TimeOut) Then
[Commands]
*** Below is where I need to move to the subform and check each record; there are 3 different if/then statements I need to run on each subform record ***
ElseIf [checking date/time on subform records] Then
[Commands]
Else
GoTo CheckReservation2
End If
Private Sub cmdCloseCO_Click()
On Error GoTo Err_cmdCloseCO_Click
Dim StrMsg As String
StrMsg = "The check out information has been changed."
StrMsg = StrMsg & " Do you want to save the changes?"
If MsgBox(StrMsg, vbYesNo, "") = vbNo Then
[Commands]
Else
If IsNull(Me.DateOut) Then
[Commands]
ElseIf IsNull(Me.TimeOut) Then
[Commands]
*** Below is where I need to move to the subform and check each record; there are 3 different if/then statements I need to run on each subform record ***
ElseIf [checking date/time on subform records] Then
[Commands]
Else
GoTo CheckReservation2
End If