Check Box IIF Statement

cktcPeterson

Member
Local time
Today, 03:43
Joined
Mar 23, 2022
Messages
74
I have a check box (cbxPC)

I want an iff statement

when true, then

[PremierCourseCredit]=[Award Amount]

if false then [PremierCourseCredit]=0

Not sure how to write it or where to put the code.

Thanks
 
I would use a standard If statement?
I would also use the AfterUpdate event.
 
so

=IIF([cbxPC],[PremierCourseCredit]=[Award Amount], "0")

The code turns red.
 
No. I said a standard IF statement. :(
Code:
If Me.cbxPC Then
    Me.PremierCourseCredit = Me.AwardAmount ' get rid of spaces in field/Control names
Else
    Me.PremierCourseCredit = 0
End If

You are trying to use an expession which *might* work in PremierCourseCredit control, but not with that syntax.
 
Thank you for this. Is it okay to have an _?
I updated the field to Award_Amount

However the code is not working.
 
I have a check box (cbxPC)

I want an iff statement

when true, then

[PremierCourseCredit]=[Award Amount]

if false then [PremierCourseCredit]=0

Not sure how to write it or where to put the code.

Thanks
Code:
If Me.cbxPC = True Then
    Me.PremierCourseCredit = Me.AwardAmount
Else
    Me.PremierCourseCredit = 0
End If
Put the code in the OnClick event of the cbxPC checkbox control
 

Users who are viewing this thread

Back
Top Bottom