troubleshooting Question

BeforeUpdate Subroutine on Checkbox

Avatar of Kevin
KevinFlag for United States of America asked on
DatabasesVBA
5 Comments1 Solution61 ViewsLast Modified:
I posted a question last week asking “How to remove/Delete data when unchecking a Checkbox”. This question was answered, but in working the problem I came up with a different issue. I have explained what is happening below and ask for assistance figuring this out.
The objective:
If the Return checkbox is checked, and the date and time are entered this is a complete record.
If the “Returned” checkbox is checked, and for some reason it is decided to uncheck it, which would (hide) the “Return Date” or Return Time” controls this data needs to be removed. This keep the database from having data in the table that can’t be seen on the form.
Currently the code in the Before Update Subroutine is working backwards.
On Record one (1) the checkbox is checked and both “Return Date” and “Return Time” are empty. When unchecked the message box should not fire, but it does.
On Record two (2) the checkbox is checked and both “Return Date” and “Return Time” are entered. When unchecked the message box does not fire, and both controls are made invisible leaving the data in the fields. It should give a warning from the message box.
These two conditions are working backwards of what should happen. I have studied the chkReturned_BeforeUpdate code, but just don’t see where the problem is.
RefusedBooking_postversion_Answer1.zip
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros