J
joecosmides
Hello,
I have a form called UpdateInventoryF. (In it are 3 checkboxes.
NewItem, UsedItem, and RefurbItem.)
That form is set to Continous Forms. As a test I have the following
code in the Form Unload event:
Private Sub Form_Unload(Cancel As Integer)
If Not Me.NewItem Then
MsgBox "No fields can be left blank.", vbOKOnly, "Message."
Exit Sub
End If
End Sub
I'm only using the Me.NewItem for now as a test in my IF statement and
I'll add the other 2 checkboxes with your help.
It works fine but only for one record. If I happen to have, for
example, 10 results on the UpdateInventoryF (continuous form) then the
form closes without displaying the error message for the other 9
records. I want it to check all of the records on the form and pop the
message box if any of the records happen to have a null value in those
checkbox fields. I then want it to not close the form until the user
has corrected the problem which would mean they need to check one of
those 3 boxes. A bonus (but not needed at this point) would be for it
to take the user to the record that needs is throwing the error/Msgbox
and if more than one needs attention then it will do it again and take
them to the next one after they try to close the form again, etc.
Thanks!
I have a form called UpdateInventoryF. (In it are 3 checkboxes.
NewItem, UsedItem, and RefurbItem.)
That form is set to Continous Forms. As a test I have the following
code in the Form Unload event:
Private Sub Form_Unload(Cancel As Integer)
If Not Me.NewItem Then
MsgBox "No fields can be left blank.", vbOKOnly, "Message."
Exit Sub
End If
End Sub
I'm only using the Me.NewItem for now as a test in my IF statement and
I'll add the other 2 checkboxes with your help.
It works fine but only for one record. If I happen to have, for
example, 10 results on the UpdateInventoryF (continuous form) then the
form closes without displaying the error message for the other 9
records. I want it to check all of the records on the form and pop the
message box if any of the records happen to have a null value in those
checkbox fields. I then want it to not close the form until the user
has corrected the problem which would mean they need to check one of
those 3 boxes. A bonus (but not needed at this point) would be for it
to take the user to the record that needs is throwing the error/Msgbox
and if more than one needs attention then it will do it again and take
them to the next one after they try to close the form again, etc.
Thanks!