Display .5 in field?

M

May

Assume you create a text control with the name text3
Dim str As String
Dim stringlocation As Integer
Dim y As Integer
Dim roundnum As Double
Dim result As Double
Let stringlocation = InStr(Text3, ".")
Let y = Mid(Text3, stringlocation + 1, 2)
Select Case y
Case 1 To 2
roundnum = 0
Case 3 To 8
roundnum = 0.5
Case 9
roundnum = 1
End Select
Let result = Left(Text3, stringlocation - 1) + roundnum
MsgBox result

May
MCP in Access and SQL Server
 
H

Harproy

Wow. You don't know how much that helped me out! Thank you SO much! Now I
can sleep!

Harp...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top