Solved

MS Access Checkbox IF

Posted on 2010-11-08
6
472 Views
Last Modified: 2012-05-10
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
Comment
Question by:rutlandict
6 Comments
 

Expert Comment

by:lancegallagher_expertsexchange
Comment Utility
You can just set the check box control to locked
0
 

Author Comment

by:rutlandict
Comment Utility
There's no other option besides this? Thanks
0
 

Expert Comment

by:lancegallagher_expertsexchange
Comment Utility

Me.Check604.Value = False
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 19

Expert Comment

by:MINDSUPERB
Comment Utility
Where did you put that code? Try to put that code on the Close event of the form.

Sincerely,
Ed
0
 
LVL 19

Accepted Solution

by:
MINDSUPERB earned 500 total points
Comment Utility
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
 
LVL 30

Expert Comment

by:hnasr
Comment Utility
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

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now