Results 1 to 6 of 6

Thread: User Currency Input

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2000
    Posts
    25

    Post

    I am trying to find the best way to force a user to enter a currency amount. I have tried using the maskedit box but I find it unfriendly. For instance when you press the period it doesn't automatically go to the decimal portion of the currency amount.
    Is there a better way?

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    If you want to avoid using the MaskEdit control tnen you can use a regular TextBox and restric the user to have only 2 (or whatever number) of decimal points there. Put this code on KeyPress event of that TextBox:
    Code:
    Private Sub Text1_KeyPress(KeyAscii As Integer)
        Select Case KeyAscii
            Case 8
            Case 46
                If InStr(Text1.Text, ".") Then KeyAscii = 0
            Case Else
                If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0
                If InStr(Text1.Text, ".") Then
                    If Len(Mid(Text1.Text, InStr(Text1.Text, ".") + 1)) = 2 Then
                        KeyAscii = 0
                    End If
                End If
        End Select
    End Sub
    This will allow only Numbers, Decimal Point and Backspace.

  3. #3
    New Member
    Join Date
    Mar 2004
    Posts
    2

    Talking CURRENCY,MASKEDIT

    i trying to entering credit currency value (negative)from interface direct to database- , the problem is ,interface cannot accep negative valua. Any idea's?

  4. #4
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: CURRENCY,MASKEDIT

    Originally posted by v-kool
    i trying to entering credit currency value (negative)from interface direct to database- , the problem is ,interface cannot accep negative valua. Any idea's?
    What was the format set for negative number? -10 or (10)?

  5. #5
    New Member
    Join Date
    Mar 2004
    Posts
    2
    The format is -10 .(from interface) , but in database, (10) or -10
    i prefer databse read -10 and the interface read -10.access and sql server6.0 ,

  6. #6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width