How to disable a checkbox unless a text box has been filled in? (1 Viewer)

BadBoy House

Registered User.
Local time
Today, 06:40
Joined
Oct 8, 2009
Messages
54
I have a checkbox on a form called 'Close Job'. I would like to prevent this checkbox from being checked/ticked unless a date has been entered in the 'Actual Billed Date' field which is also on the report.

Can this be done?

The icing on the cake would be for the form to display a popup message along the lines of "Bill date not entered" if someone was to click on the checkbox and the date had not been entered.




Thanks in advance.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:40
Joined
Oct 29, 2018
Messages
21,454
Hi. Both are possible. You can use Conditional Formatting to disable the checkbox and VBA or macro to show the message.
 

BadBoy House

Registered User.
Local time
Today, 06:40
Joined
Oct 8, 2009
Messages
54
Is it possible to use conditional formatting on a checkbox? Ideally the checkbox would be visible at all times, but it wouldn't let you check the box unless the date field has been filled in.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:40
Joined
Oct 29, 2018
Messages
21,454
Hi. Good question. Only one way to find out. If it's not possible, then disabling won't probably possible. Rather, you may have to go the validation route where if the user checks it and they're not supposed to yet, then you reverse the action and let them know.
 

BadBoy House

Registered User.
Local time
Today, 06:40
Joined
Oct 8, 2009
Messages
54
Nope conditional formatting doesn't work on checkboxes unfortunaely :(

I'll look into what a validation rule is.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:40
Joined
Oct 29, 2018
Messages
21,454
Nope conditional formatting doesn't work on checkboxes unfortunaely :(

I'll look into what a validation rule is.
I just checked it as well. Too bad. I was thinking more along the lines of using VBA code in the AfterUpdate event of the checkbox. Is the checkbox bound or unbound?
 

BadBoy House

Registered User.
Local time
Today, 06:40
Joined
Oct 8, 2009
Messages
54
I've figured it out - I set the validation rule on the checkbox as follows:

Not IsNull([ActualBilledDate])

and then entered a message in the Validation Text property.

Seems to work perfectly! Thanks for your help!
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:40
Joined
Oct 29, 2018
Messages
21,454
Hi. Congratulations! Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom