Solved

Values in a Form

Posted on 2011-03-02
7
297 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

747 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now