IIf Statement with a Check Box Question

sondriven

Registered User.
Local time
Today, 13:40
Joined
Jun 13, 2002
Messages
158
I have a simple check box form that tells me if a shipment has been delivered On Time or not. Check if it was on time.

I want the check box value to be 1 instead of -1.

I tried this statement in the control source:

=IIf([On Time]=True,1,0)

And I tried this too.

=IIf([On Time]=True,1)

Both do the same thing. Completely greys out the box and I can add or take away a check.

Thanks for taking the time to help.
 
Any form control items (eg. field, checkbox etc) value cannot be changed if its control source is based an a calculation.

Instead created an afterudate event of your check box and change its value based on a calculation


e.g suppose your check box is called "chk_ontime", simply overright the stored value of "-1" with an inverted value (- becomes positive)

Private Sub chk_OnTime_AfterUpdate()
Me.chk_OnTime = Me.chk_OnTime * (-1)
End Sub
hth

Smed
 

Users who are viewing this thread

Back
Top Bottom