Value of Yes or No on Form

statsman

Active member
Local time
Today, 12:48
Joined
Aug 22, 2004
Messages
2,082
I have a form which deals with complaints about employees.

One of the fields is a Yes/No radio button. The field is labeled "No Merit". If a complaint is found by the investigator to have no merit, he clicks the button.

There is another field titled "Investigator Comments". If the No Merit is clicked and the Investigator Comments is blank, I want a message box to come up saying that the reason for no merit must be explained in the Comments field.

So far so good, the problem is that when I do the coding to bring up the message box, I don't get the box. I believe the problem is that I don't know what the conditions are for the radio button = yes.

Help please.
 
Is this a Yes/No checkbox or is it a radiobutton?
If it is a Yes/No checkbox, the value for Yes is -1 (negative 1).

Otherwise, it sounds like a simple
IF ____ AND _____
THEN

statement type. I believe that any code would go in the AfterUpdate event of the checkbox to drive what you are requesting. You would use it t oset the Visible property to Yes if the checkbox is -1 and the Reason is NULL. I've done that in the past and it works pretty well.
 
Worked like a charm.
You do indeed rock.
 
Also!!!

I use this kind of code to have subforms visible under certain circumstances as well. But, if you do something like that, make sure you repeat the code in the On Open and On Current events as well, so that as you open the main form or move between records, you will get consistency in the results. Glad I could help.
 

Users who are viewing this thread

Back
Top Bottom