Help with Form & Subform IIf forumla (i think)

IIF([Carpet or Not] = -1, FORMULA, "0")

IIF(Condition, IF TRUE, IF FALSE).

The condition will have to use the field name or the control name, just incase it's different than the "Caption" you have shown.

It seems you want the IIF inside the Discount column,
IIF([Carpet or Not] = -1, "10", "0")

If the Carpet or Not is true (-1) then discount is 10, else discount is 0.
 
IIF([Carpet or Not] = -1, FORMULA, "0")

IIF(Condition, IF TRUE, IF FALSE).

The condition will have to use the field name or the control name, just incase it's different than the "Caption" you have shown.

It seems you want the IIF inside the Discount column,
IIF([Carpet or Not] = -1, "10", "0")

If the Carpet or Not is true (-1) then discount is 10, else discount is 0.

thanks yeah carpet or nots thingy is carper or not cos of a stupid typo
i changed it to this and it says
#Name? :( & also i shud be able to type any number i want in the discount
 
AH ok, sorry I misunderstood.

You're IIF should be in the Amount Discount column as:

=IIf([carpet or not]=-1,([Discount]/100)*[Item Price],0)

Note that I did /100 because I wasn't sure if your field is really a percentage or just a number.
 
AH ok, sorry I misunderstood.

You're IIF should be in the Amount Discount column as:

=IIf([carpet or not]=-1,([Discount]/100)*[Item Price],0)

Note that I did /100 because I wasn't sure if your field is really a percentage or just a number.



yay thankssss:)
the ones when their isnt check boxes work fine but where there is it says #Error and also it doesnt let me type anything in the discoutn collumn now?
 
The discount will have to be a field in the table, and there should be no IIF attached to it (The IIF goes inside the Discount Amount).

The #Error might be caused because of the naming scheme, make sure the title of the textboxes is used in the formula, I believe that's what the formula looks for. My attached example should show this.
 
yay thankssss:)
the ones when their isnt check boxes work fine but where there is it says #Error and also it doesnt let me type anything in the discoutn collumn now?

Make sure you check the sample that DevastatioN gave you. It works great and so you have to realize that there are two fields there (1. the discount percentage where you can type in and 2. the discount amount where you can't type in). Hopefully that helps you.
 
Make sure you check the sample that DevastatioN gave you. It works great and so you have to realize that there are two fields there (1. the discount percentage where you can type in and 2. the discount amount where you can't type in). Hopefully that helps you.
YAYAYAYA it works thank you so so so much :)
(i was putting it in the dicount field not ammount discount) silly me!

can you please help me with one more thingy
ive just done a screen shot

right ya no at the top where it says area whats the forumla so the number i type in there comes in the quanity columnm for all the carpets (rows with the checked boxes) and the number i typed in the priemeter one - to come in all the things that arent carpet.?
if that makes any sense

http://i161.photobucket.com/albums/t...untitled-1.jpg
http://www.access-programmers.co.uk/forums/editpost.php?do=editpost&p=821109
 
i was supose to reply to DevastatioN post...sorryy

Unlike Utter Access it doesn't matter which one you use on this forum. If someone is "subscribed" they will get the notifications. Don't worry about it at all.
 
just relised what i asked up there ^ is wrong
I want to do it so the area required appears in all of the products apart from one of them? how do i go about doing that, if thats possible (in the quanity column) & then the primeter to only appear for one patricular product
 
I don't fully understand what you are trying to do. Could you explain in a bit more detail? If you wish to use the fields from the main form, referenced from the subform, Forms!formname!controlname.
 

Users who are viewing this thread

Back
Top Bottom