-
Solved: display 100% maximum
[VBA]Dim v As String
v = Replace(Me.MPct, "%", "")
Me.MPct = Val(v) & "%"
[/VBA]
I have this code that allows the user to enter percent number. I would like to prevent the user from enter anything greater than 100%.
i.e. if the user types 150% and exits from the textbox, display the amount as 100%. if the user enters 50% and exits from the textbox, then it displays 50%.
thank you for your help
-
Like this:
[VBA] Dim v As String
v = Replace(Me.MPct, "%", "")
If Val(v) > 100 Then v = 100
If Val(v) <= 0 Then v = 0
Me.MPct = v & "%"
[/VBA]
Artik
-
Works Great...Thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules