473,487 Members | 2,474 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to give formula in My issue

30 New Member
Hello friends, Can anyone help on my issue

I need some calculation formula about Cust. Disc% and CustDisc Amt fields.

Both of direct punching fields so in this case i need a formula that is if enter the percentage value in Cust.Disc% field then update automatically CustDisc Amt field. Or enter a value in CustDisc Amt field then update automatically Cust.Disc% field with each MRP and Qty wise as per screenshot values. Both fields are enter the values as choice wise so how to give a formula both fields?
Attached Images
File Type: jpg Screenshot2.jpg (46.4 KB, 160 views)
Nov 11 '14 #1
2 936
jforbes
1,107 Recognized Expert Top Contributor
Add a couple of AfterUpdate Events for CustDisc and CustDiscAmt that update the other related field. You will need to use your actual field names for the example below:
Expand|Select|Wrap|Line Numbers
  1. Private Sub CustDisc_AfterUpdate()
  2.     ' Discount Amount = MRP * Discount Percent
  3.     Me.CustDiscAmt.Value = Nz(Me.MRP.Value,0) * Nz(Me.CustDisc, 0)
  4. End Sub
  5. Private Sub CustDiscAmt_AfterUpdate()
  6.     ' Discount Percent = Discount Amount / MRP
  7.     If Nz(Me.MRP.Value,0)=0 Then
  8.         Me.CustDisc.Value = 0
  9.     Else
  10.         Me.CustDisc.Value = Nz(Me.CustDiscAmt, 0)/Nz(Me.MRP.Value,0)
  11.     End If
  12. End Sub
  13.  
Additionally, you'll want to trap for a divide by zero error
Nov 11 '14 #2
Sandhya1988
30 New Member
Thank you so much for your replay its working perfectly :)
Nov 11 '14 #3

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

Similar topics

4
1983
by: Phoon Chee Keong | last post by:
Is that a formula in vb.net like Ms Excel? Currently my Excel formula is "=(((ROUNDUP(I30/3000,0)+1)*G30)/1000)+((ROUNDUP(G30/10000,0))*I30/1000)", but in vb.net how to write. Any idea? ...
1
2670
by: Dim | last post by:
Hi, need some help/idea... I have data table in Excel(about 30 columns) and it's getting too big (over 65K) so I need to move it to DB (MS Access is the choice) one of the columns (for example...
3
1700
by: Stan Sainte-Rose | last post by:
Hi, How to eval a formula on the fly ? I have a table where I store some formula like "(5+9)/2" Each number reffers to a row so that gives (row(5)+row(9))/row(2) I think if someone could...
3
5087
by: Mike | last post by:
Hi, I have three tables in the following structure (simplified): Table 1: Containing the customers ------------------------------------------------- create table Customers ( int...
7
1745
by: Bobh | last post by:
I am trying to figure out some code for a report issue; I have an employee who has a incentive scheme. I have a report showing various income amounts and in the report footer I vae totals for...
3
1187
by: muddasirmunir | last post by:
i am using vb6 and crystal report 10 with sqlserver 2000 i made a formulal field in crystal report 10 where i had a table name sales , it has two numeric fields credit and debit and give theme...
30
5641
by: Barry L. Bond | last post by:
Greetings! I just got a new Peet Brothers Ultimeter 2100 Weather Station. This new one has a way to display the heat index, if you press the "dew point" key twice. Being aware of all the...
9
8342
by: RhythmlinkSam | last post by:
Hi everyone, I need some help with a slope formula. My company uses a spreadsheet where one line uses the SLOPE formula. I found from my research on the internet that there is no similar...
4
1884
by: mattb2bad | last post by:
Hello there, I am having a slight issue with a formula input for Access. our teacher gave us this formula to put in for a specific step and i keep getting the error code 2048. Can someone please...
0
7106
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7181
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7349
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
5442
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,...
0
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.