Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Truncating numbers over 9999 1

Status
Not open for further replies.

load3d

Programmer
Feb 27, 2008
117
US

I have a field on my form with a control name of Equipment Hours (me.equipmenthours) when a user enters 9990 hours into the hours field that means that the vehicle hours are about to roll back to 0000 (9999 max). I need to add 24 to that value of 9990 that the users enter into the field and store that value for future error checking.

For example:

A user enters 9990 into the equipment hours field.
I need to add 24 to that number to equal 0014 and store that value for error checking in the future. How do I truncate anything over 9999 to be 0 + that number? I want to make the equipment hours field be my current hours and equipment hours + 24 to be the maximum number of hours allowed to enter the next time the hours are checked. I have a problem with the users entering the wrong hours and I don't know how to prevent it. Any other ideas or criticisms will be appreciated.

 
A starting point:
MsgBox (Format((9990+24) MOD 10000, "0000")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks.... I tried that and I looked at the data and it read
10019. So..... I did something like this...


IF me.eHours > 9999 then me.eHours = (me.ehours - 100000)

the end result is the number I need.

What is the MOD function?

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top