Please help, I'm a newbie...I don't know VBA all that well (I know those newbie can be a pain...)
I'm trying run a code that require one of two check box fields to be checked. If both are checked or if neither are checked, a msgbox appears and the user cannot save the record until only one is checked. If one of the two is checked, then I run a macro.
Well here's my code:
Private Sub update_proj_button_Click()
If (Me.top_1000 = 0 And Me.Never_out = 0) Or (Me.top_1000 = 1 And Me.Never_out = 1) Then
MsgBox "Most chose only one", vbOKOnly
DoCmd.CancelEvent
Else
DoCmd.SetWarnings False
DoCmd.OpenQuery "update to oprj", acNormal, acEdit
DoCmd.SetWarnings True
DoCmd.Requery
I keep getting an compile error...
Any ideas? I appreciate any assistance...
I'm trying run a code that require one of two check box fields to be checked. If both are checked or if neither are checked, a msgbox appears and the user cannot save the record until only one is checked. If one of the two is checked, then I run a macro.
Well here's my code:
Private Sub update_proj_button_Click()
If (Me.top_1000 = 0 And Me.Never_out = 0) Or (Me.top_1000 = 1 And Me.Never_out = 1) Then
MsgBox "Most chose only one", vbOKOnly
DoCmd.CancelEvent
Else
DoCmd.SetWarnings False
DoCmd.OpenQuery "update to oprj", acNormal, acEdit
DoCmd.SetWarnings True
DoCmd.Requery
I keep getting an compile error...
Any ideas? I appreciate any assistance...