473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

I need some optional calculation formula in a form

I need some optional calculation formula in a form

My Subform Fields:
Quantity -50
Selling Price1-$250 (this is the 2nd preferred)
ADisc Price2- $240 (this is the 1st preferred)
Amount: CCur(Nz([Quantity]*[ADisc Price2],0) Or CCur(Nz([Quantity]*[Selling Price1],0)

Actually my calculation is Quantity * ADisc Price2 Or if ADisc Price2 field is “0 “then will take from Selling Price1 field.
ADisc Price2 field is after discount deduct amount so this is the 1st preferred for calculation total amount but some time no discount allowed ADisc filed is “0” that time how to give a formula?? I have used the formula above in Amount field but that is not working properly. So can you please replay how to take a formula?

Thanks.
Nov 20 '14 #1
2 947
jforbes
1,107 Expert 1GB
I think you are looking for an iif() (inline if, https://support.office.com/en-us/art...0-647539c764e3):
Expand|Select|Wrap|Line Numbers
  1. iif(CCur(Nz([Quantity]*[ADisc Price2],0)=0, CCur(Nz([Quantity]*[Selling Price1],0), CCur(Nz([Quantity]*[ADisc Price2],0))
Nov 21 '14 #2
Perfect - Thank you very much!
Nov 21 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Pete | last post by:
Hi Guys I have a form which must calc the difference between 2 date fields and return the result in a third field. I have the following code but it does not seem to work. Can anyone tell this...
0
by: gavo | last post by:
Hi. using A2K; i have a form containing a continous subform. The question is, how can i call a calculation for one of the fields in the continous subform from the main form. At the moment i...
8
by: rdavis7408 | last post by:
I am attempting what I would think would be a simple calculation of the cost of traveling a single mile. But I can not figure this out. The following is my script. Any help would be appreciated. ...
3
by: wassimdaccache | last post by:
I have tow questions GUYS 1)I need to write a string of characters in a text_box and after update I need to open a form contains product list that begin with the string wrote... I used LIKE...
0
by: josh | last post by:
HI I'm new to .asp and vbscript and I need to validate a form before it is emailed to me. I don't really understand what email functionality I have on the server (and the tech support might get...
1
by: Mohammad Nowfal | last post by:
I am working on a Sales Data page of a Rent a car database where I encounter the below problem: I have the below fields in a FORM (called Sales ) namely: 1. Odometer_Start 2. Odometer_End 3....
2
by: Anni V | last post by:
Hi Can some one please help me with the formula to find the EMI from the textbox values txtemiconvamount ddltenure txtemicalcroi to display the EMI amount in the textbox txtemiamount The...
3
by: rajeevs | last post by:
Hi All I have searched Bytes for an answer to my question so many hours. I couldnt find threads related to my problem. I have a form with 2 controls, both as short time formats. I need to get...
25
by: Rajesh Kesari | last post by:
Please Help; need to populate a form with a predecided set of fileds which may be used seperately as well. To be more specific; I have a form (frmTestValues - a continuous form) based on table...
1
by: melx | last post by:
I am working on a protected word 2007 form. How can different people track changes in the unprotected text form fields? The text appears in black and changing the track changes option doesn't change...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.