Sandra Smith
asked on
Get decimal part of a number, but store as integer ACCESS 2003 Database
I have a request for a change in recording time from just minutes to minuts and seconds. The data will be stored in the main table as, say 1.30 minutes, that is one minute and thirty seconds. On the form, there are two fields, one for minutes and one for seconds. However, if there is a value in the field already, on the form I want the minute to appear, obviously, in the minute box and the seconds in the seconds box. I amusing INT to get the interger, but I need to figure out how to get the decimals from the permanent table into the temp table as integer to be stored until they are returned to the permanent table. that is, 1.30 needs to be in two boxes and if the user updates teh seconds to say 45, then what will be returned to the permanent table is the value 1.45 (on the seconds table, the max value accepted is 59 so keeps the user from inputting what would be considered a minute number)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you both. However, I was trying to remember the mod function as I knew there was something that did this.
split the string at the decimal point
if this is a macro
sTempString= Format(str(1.3), "#0.00")
sseconds = Right(sTempString, Len(sTempString) - InStr(sTempString, "."))