Solved

Values in a Form

Posted on 2011-03-02
7
329 Views
Last Modified: 2012-05-11
I have the following code on 2 buttons in the header and 2 fields in the body of a continous form:

Values in the fields are integer numbers

Private Sub btnDOWN_Click()

PQA_L.Value = PQA_L.Value * 0.95
PQA_H.Value = PQA_H.Value * 0.95

End Sub

Private Sub btnUP_Click()
PQA_L.Value = PQA_L.Value * 1.05
PQA_H.Value = PQA_H.Value * 1.05
End Sub

If I click btn_DOWN multiple times when the value hits 10 it stops decreasing

Also, if I click btn_UP the value does not increase anymore

Can anyone tell me why?

I would like to click btn_DOWN down to 1 and be able to go back up again
0
Comment
Question by:fitaliano
  • 4
  • 2
7 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35020722
Basic math.

The lower you go, the smaller the percentage change.
The less noticeable the change.

I bet if you increased the decimal precision you will see this gradual change.
( as rounding begins to plays an ever increasing part in the value displayed)
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35020763
Also note that because of Rounding you may go down so low that going back up may not return you to the Exact previous values...


;-)

JeffCoachman
0
 
LVL 26

Accepted Solution

by:
Nick67 earned 500 total points
ID: 35028735
And multiplying by .95 and 1.05 are not reverses fo each other
Choose * .95 and /.95 OR
* 1.05 and /1.05 and the buttons will reverse each other effects within the limits of the precision you have chosen for your variables
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35030454
Thanks Nick67,

Will you be answering more questions and become an "Expert" here?

0
 
LVL 26

Expert Comment

by:Nick67
ID: 35031404
@boag2000

I've learned a lot from this site and like to contribute something back when circumstances permit
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35031550
;-)

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question