hollyquinn
Registered User.
- Local time
- Today, 12:38
- Joined
- Oct 7, 2008
- Messages
- 17
Hi I have a question about a VBA Module that I'm looking at for a form. There are some conditional statements that checks to see if some drop down lists are have null values, and then if they do it displays an error message. The part that is confusing me, is that at the end of the sub routine, the DoCmd.Save command is called. I don't see that anything in particular is saved, so I'm unsure what's going on. Here's the code if someone can help. Thanks in advance.
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Not IsNull(Me.BidPeriod) And IsNull(Me.Crew) Then
MsgBox "Please enter data for BOTH the the Bid Period and Crew Group, or blank for both!" _
& Chr(10) & " " _
& Chr(10) & "ASOK requires a Bid Period and a Crew Group to update the Training Schedule Matrix.", vbCritical + vbOKOnly, "ASOK Session Save"
Me.BidPeriod = Null
Me.Crew = Null
Cancel = True
Exit Sub
End If
If IsNull(Me.BidPeriod) And Not IsNull(Me.Crew) Then
MsgBox "Please enter data for BOTH the the Bid Period and Crew Group, or blank for both!" _
& Chr(10) & " " _
& Chr(10) & "ASOK requires a Bid Period and a Crew Group to update the Training Schedule Matrix.", vbCritical + vbOKOnly, "ASOK Session Save"
Me.BidPeriod = Null
Me.Crew = Null
Cancel = True
Exit Sub
End If
DoCmd.Save
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Not IsNull(Me.BidPeriod) And IsNull(Me.Crew) Then
MsgBox "Please enter data for BOTH the the Bid Period and Crew Group, or blank for both!" _
& Chr(10) & " " _
& Chr(10) & "ASOK requires a Bid Period and a Crew Group to update the Training Schedule Matrix.", vbCritical + vbOKOnly, "ASOK Session Save"
Me.BidPeriod = Null
Me.Crew = Null
Cancel = True
Exit Sub
End If
If IsNull(Me.BidPeriod) And Not IsNull(Me.Crew) Then
MsgBox "Please enter data for BOTH the the Bid Period and Crew Group, or blank for both!" _
& Chr(10) & " " _
& Chr(10) & "ASOK requires a Bid Period and a Crew Group to update the Training Schedule Matrix.", vbCritical + vbOKOnly, "ASOK Session Save"
Me.BidPeriod = Null
Me.Crew = Null
Cancel = True
Exit Sub
End If
DoCmd.Save
End Sub