If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
number display
I have unbound text boxes on a form for entry of time in
HH:MM:SS format. Someone is the newsgroup helped me with the code to convert/save the time as HH only and on the Form_Current event I have the following code to display the data back: If Not IsNull(Me![RunTime]) Then Me!Text96 = Me![RunTime] * 3600 Me!txtHr = Me![Text96] / 3600 Me!txtMin = Me![Text96] / 60 Mod 60 Me!txtSec = Me![Text96] Mod 60 End If But I don't want the txtHr to display any decimal places ie;1.67 in RunTime should display 1:40:00 but it's obviously displaying 1.67:40:00 because of my code. I have the decimal properties set to 0 and if I shrink the box it will round off the number which I also don't want. Any ideas? Thanks for the help. |
#2
|
|||
|
|||
number display
Change Me!txtHr = Me![Text96] / 3600 to Me!txtHr = Me![Text96] \ 3600. Using
the \ (backslash) does Integer division and will only return the integer part. -- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm "ME" wrote in message ... I have unbound text boxes on a form for entry of time in HH:MM:SS format. Someone is the newsgroup helped me with the code to convert/save the time as HH only and on the Form_Current event I have the following code to display the data back: If Not IsNull(Me![RunTime]) Then Me!Text96 = Me![RunTime] * 3600 Me!txtHr = Me![Text96] / 3600 Me!txtMin = Me![Text96] / 60 Mod 60 Me!txtSec = Me![Text96] Mod 60 End If But I don't want the txtHr to display any decimal places ie;1.67 in RunTime should display 1:40:00 but it's obviously displaying 1.67:40:00 because of my code. I have the decimal properties set to 0 and if I shrink the box it will round off the number which I also don't want. Any ideas? Thanks for the help. |
#3
|
|||
|
|||
number display
Thanks a bunch Lynn.
-----Original Message----- Change Me!txtHr = Me![Text96] / 3600 to Me!txtHr = Me! [Text96] \ 3600. Using the \ (backslash) does Integer division and will only return the integer part. -- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm "ME" wrote in message ... I have unbound text boxes on a form for entry of time in HH:MM:SS format. Someone is the newsgroup helped me with the code to convert/save the time as HH only and on the Form_Current event I have the following code to display the data back: If Not IsNull(Me![RunTime]) Then Me!Text96 = Me![RunTime] * 3600 Me!txtHr = Me![Text96] / 3600 Me!txtMin = Me![Text96] / 60 Mod 60 Me!txtSec = Me![Text96] Mod 60 End If But I don't want the txtHr to display any decimal places ie;1.67 in RunTime should display 1:40:00 but it's obviously displaying 1.67:40:00 because of my code. I have the decimal properties set to 0 and if I shrink the box it will round off the number which I also don't want. Any ideas? Thanks for the help. . |
#4
|
|||
|
|||
number display
You're welcome.
-- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm "ME" wrote in message ... Thanks a bunch Lynn. -----Original Message----- Change Me!txtHr = Me![Text96] / 3600 to Me!txtHr = Me! [Text96] \ 3600. Using the \ (backslash) does Integer division and will only return the integer part. -- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm "ME" wrote in message ... I have unbound text boxes on a form for entry of time in HH:MM:SS format. Someone is the newsgroup helped me with the code to convert/save the time as HH only and on the Form_Current event I have the following code to display the data back: If Not IsNull(Me![RunTime]) Then Me!Text96 = Me![RunTime] * 3600 Me!txtHr = Me![Text96] / 3600 Me!txtMin = Me![Text96] / 60 Mod 60 Me!txtSec = Me![Text96] Mod 60 End If But I don't want the txtHr to display any decimal places ie;1.67 in RunTime should display 1:40:00 but it's obviously displaying 1.67:40:00 because of my code. I have the decimal properties set to 0 and if I shrink the box it will round off the number which I also don't want. Any ideas? Thanks for the help. . |
Thread Tools | |
Display Modes | |
|
|