Iif statement not putting data into tables?

Username1234

New member
Local time
Today, 04:43
Joined
Apr 1, 2014
Messages
1
I am doing an assignment for uni and need to be able to autofill a textbox with the price of a service based on whether a checkbox, detailing whether the invoice has been paid, is ticked. I found the following formula which works: =IIf([Invoicepaid]=True,[ServPrice],0).

I put this into the control source box on my form but the only problem im having is that the price of the service is not being updated into the actual invoice table.

I'm very new to Access, so hardly know anything. Any help would be much appreciated. Thanks.
 
It would seem the price is a derived value which you shouldnt store anyways....

Plus your control wont have a "source" to put your data in, so how would it magicaly know what to store?
 
You would have to put a field in your table and use code to assign the bound control a value. As namliam has stated, this is not advisable.

A better idea would be to put your if statement into a query like this:

ExprName: IIf([Invoicepaid]=True,[ServPrice],0)

Then you can use that query whenever it is needed.
 

Users who are viewing this thread

Back
Top Bottom