Tick box code when value = ###

james_IT

Registered User.
Local time
Today, 12:37
Joined
Jul 5, 2006
Messages
208
hi,

what would the code be if i wanted a tick box called 'paid?' to be true once a field on my form called 'amount outstanding' = £0?

thanks
 
Code:
If [Forms]![[I]form name[/I]]![Field Outstanding] = 0 Then
       [Forms]![[I]form name[/I]]![Paid] = True
End If
 
Why would you want to store redundant data?
 
thanks for your reply...where would the code go? i tried it on the after update event of the field outstanding and nothing happened?...

If [Forms]![frmAddNewEvent]![Outstanding] = 0 Then
[Forms]![frmAddNewEvent]![Paid?] = True
End If
 
Last edited:
ok i understand. but where would the code go? in the after update event of the outstanding balance field? also, before to search for outstanding payments i just made a query that searched for all the Paid?=False. How can it be done now that i am not storing the field Paid?

thanks
 
Since you have already decided that Paid means Outstanding = 0 then look for [Outstanding] <> 0. What causes the [Outstanding] field to get its value? You may be fighting a slight design SNAFU.
 
basically:

sub form total (calculated)
then discount (unbound/recorded)
then total (calculated by subform total - discount)
then deposit (unbound/recorded)
then balance paid to date (unbound/recorded)
then amount outstanding (calculated by total-deposit-balance paid to to date)
 
ive removed the Paid? field from my tables and forms - it is now calculated in the forms.

my only problem is with these outstanding payments...

i fear i may be facing a structure/design problem?
 
Use queries to calculate outstanding invoices etc., you can then base a form/report on the query to display them
 
perfect - done that.

it wont let me enter a criteria for calculated fields in a query. i want to enter >0 for amount outstanding and it just asks me to enter a value for another calculated field...?
 

Users who are viewing this thread

Back
Top Bottom