"You entered an expression that has no value" (1 Viewer)

Lkwdmntr

Registered User.
Local time
Yesterday, 17:50
Joined
Jul 10, 2019
Messages
281
I have a checkbox that is not checked and I am checking the value of it in the code with an if statement. I keep getting this error "You entered an expression that has no value."
I am stumped. I have used this format before and it works, but for some reason, it is not working now. Here is the code I am using. I have also tried the .value after the field and using 0 instead of True.

Code:
If Me.chkMealPlanStatus = True Then
    Me.CompleteWeekbtn.Enabled = True
Else
    Me.CompleteWeekbtn.Enabled = False
End If

Any help would greatly be appreciated.
 

Isaac

Lifelong Learner
Local time
Yesterday, 17:50
Joined
Mar 14, 2017
Messages
8,777
Click Debug and let us know which line of code is highlighted thereafter
 

Lkwdmntr

Registered User.
Local time
Yesterday, 17:50
Joined
Jul 10, 2019
Messages
281
Click Debug and let us know which line of code is highlighted thereafter
Sorry, I should have included that. It's the first line of code. "If Me.chkMealPlanStatus.Value = True Then"
 

plog

Banishment Pending
Local time
Yesterday, 19:50
Joined
May 11, 2011
Messages
11,643
This may not fix your issue, but the pedantic logician inside me just cant help to point out that you should just set Me.CompleteWeekbtn.Enabled to the value of Me.chckMealPlanStatus
 

Lkwdmntr

Registered User.
Local time
Yesterday, 17:50
Joined
Jul 10, 2019
Messages
281
That does make complete sense. I changed it, but it still shows the same error.
 

Lkwdmntr

Registered User.
Local time
Yesterday, 17:50
Joined
Jul 10, 2019
Messages
281
Ok, so I found my problem. My bad. I was accessing a plan that wasn't created yet. I feel pretty stupid.
My code is a little cleaner now, thanks!
 

Users who are viewing this thread

Top Bottom