Solved

Values in a Form

Posted on 2011-03-02
7
322 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

822 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