Results 1 to 9 of 9

Thread: no numbers (2k)

  1. #1
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    no numbers (2k)

    Can i put in the feald only characters if the user do numbers msgbox " only used characters " .
    Ashraf

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: no numbers (2k)

    You can put an input mask on the field. For example, if you want to allow a maximum of 5 letters, use

    ?????

    The ? stands for a letter A-Z, and character entry is optional - the user may leave it blank. If you don't want to use an input mask, you can use the On KeyPress event of the text box to suppress digits:

    Private Sub txtSomething_KeyPress(KeyAscii As Integer)
    If KeyAscii > 47 And KeyAscii < 58 Then
    KeyAscii = 0
    End If
    End Sub

    where txtSomething is the name of the text box.

  3. #3
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: no numbers (2k)

    It is a nice answer .
    Thank u dear .
    Ashraf

  4. #4
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: no numbers (2k)

    if i want the inverse write only numbers .

  5. #5
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: no numbers (2k)

    If you use an input mask use :
    99999 (Digit or space entry not required, plus and minus signs not allowed).
    or
    00000 (Digit 0 to 9, entry required, plus [+] and minus [
    Francois

  6. #6
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: no numbers (2k)

    Welcome Francois
    I test the Code but also write charcters and numbers .

  7. #7
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: no numbers (2k)

    <img src=/S/blush.gif border=0 alt=blush width=15 height=15> Sorry, had to use Or instead of And. I also add keyascii 8 to be able to use the backspace.

    If (KeyAscii < 47 Or KeyAscii > 58) And KeyAscii <> 8 Then
    KeyAscii = 0
    End If
    Francois

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: no numbers (2k)

    Yet another possibility is to set the Format property of the text box to General Number (or one of the other number formats). Access will only allow the user to enter a valid number.

  9. #9
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: no numbers (2k)

    It is ok now . Thank u my friend.
    Ashraf

Posting Permissions

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