• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 506
  • Last Modified:

MS Access Checkbox IF

Hi Experts,

I have a checkbox with event function IF statement.

If Me.Check604 = False Then
MsgBox ("Please complete the form")
End If

So what happen here is, a msgbox appeared and the Check604 is checked.

What code should I input to let check604 remain uncheck?

Thanks.
0
rutlandict
Asked:
rutlandict
1 Solution
 
lancegallagher_expertsexchangeCommented:
You can just set the check box control to locked
0
 
rutlandictAuthor Commented:
There's no other option besides this? Thanks
0
 
lancegallagher_expertsexchangeCommented:

Me.Check604.Value = False
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
MINDSUPERBCommented:
Where did you put that code? Try to put that code on the Close event of the form.

Sincerely,
Ed
0
 
MINDSUPERBCommented:
First of all, set the default value of the checkbox to 0. Then use the code below:

If Me.Check604 = 0 Then
MsgBox ("Please complete the form")
End If

See screenshot attached.

Sincerely,
Ed
DefaultValue.JPG
0
 
hnasrCommented:
You want the Checkbox to be checked. If not display the message.

So put your code int the Check604_AfterUpdate event.

You may need to validate your input in forms beforeUpdate event.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now