How to check if a option button was not selected

  • Thread starter Thread starter Guest
  • Start date Start date
If you have a question, it is customary to write it here in the body
of the post, not in the subject line.

Your subject line is not as clear cut as you may think it is, so I
would suggest flexing your finger muscles and re-post... this time
giving more information, such as your Access version #, whether this
is needed in a form or report, etc., and the circumstances why this
information is needed, as since an option group gets it's value from
the selected button, any button that is not that value is not
selected!
 
There was a problem so I didn't get to type in the rest of the message so
here it is:
I wanted to check if a option button was not selected.
I assumed 1 is true and 0 is false so it is was not selected it would be -1.
There is 1 option button for each field. Im guessing that it was suppose to
be a check mark but here is what I had and it gives me an error.
ElseIf (Me.Option4.Value = -1 And Me.Option6.Value = -1) Then
MsgBox ("Please enter a reason for termination")
 
There was a problem so I didn't get to type in the rest of the message so
here it is:
I wanted to check if a option button was not selected.
I assumed 1 is true and 0 is false so it is was not selected it would be -1.

Well, as you have seen, your assumption was incorrect. <g>

TRUE is stored as -1, False as 0. A Yes/No field usually doesn't allow
a NULL value; the default will be 0 or False. If it's not a Yes/No
field you can test to see if it is null:

If IsNull(Me!optionbox) Then...

John W. Vinson[MVP]
 
Back
Top