help with disabling a checkbox when a textbox is 0 or null

cbearden

Registered User.
Local time
Today, 15:47
Joined
May 12, 2004
Messages
84
I'm guessing that this will take coding and I don't know coding very well. I have 4 categories...I'll call them A B C D.
For each category, there is 3 text boxes, EX: A Cost, A Refund, A Rec Date
I will have a checkbox for when each is rec. but not all accounts will have every category(A, B, C, D). I'm trying to get the checkboxes for each category to be disabled if and only if the Category(A, B, C, D) Cost is NULL or 0.

Thanks in advance for the help.
 
If isNull(Acost and Bcost and Ccost and Dcost) then
chkbox.Enabled = False
Else
chkbox.Enabled = True
End If
 
Code:
chkA.Enabled = Nz(ACost, 0) <> 0
 
I've tried the post of godofhell but nothing is happening.

textbox - curCLcost
chkbox - chkCLrec

lagbolt...what is Nz?

I'm not very good with code...so please be kind. :)

Thanks!
 
Cbearden, can you post your database, it will be much easier to do it and then expalin what was done. I see that the post I placed yesterday did not show up here. Below is the NZ information per the Help file in MS Access.

LagBolt, what I mentioned on the post that did not show up is that you were correct on my code not using the NZ correctly. Thank you for keeping me honest.

You can use the Nz function to return zero, a zero-length string (" "), or another specified value when a Variant is Null. For example, you can use this function to convert a Null value to another value and prevent it from propagating through an expression.

Syntax

Nz(variant[, valueifnull])
 

Users who are viewing this thread

Back
Top Bottom