Check Box Message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a check box on a form (Yes/No field in table). I would like to
create a macro that will show a message if the check box was NOT checked.

Any help will be appreciated.

Karen
 
Why create a macro?
On the before update event of the form enter the code
If isnull(me.YesNoField) then
msgbox "Yourmessage"
cancel=true
end if
that way the user wont be able to close the form until he update the field.
 
You can use this code with how many check boxes you like
If isnull(me.YesNoField1) or isnull(me.YesNoField2) or
isnull(me.YesNoField3) then
msgbox "Yourmessage"
cancel=true
end if

Where did you put the code?
If you open the form with one record, and you dont move from one record to
another then you can put the code on the unload event of the form.
But if you move in that form between records then you should put the code in
the before update event of the form, but notice, it would work only if you
changed some records.
 
This would be for the new record that is being entered using the form. The
form will move to the next blank form for another new record.

I have put the code in the Before Update property of the form.
 
Put a code break in the code to see that it stop there, it could be that the
value is not null, its false. in that case change the code to
If me.YesNoField1=false or me.YesNoField2=false or me.YesNoField3=false then
msgbox "Yourmessage"
cancel=true
end if
 
Back
Top