• no numbers (2k)

    Author
    Topic
    #413216

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

    Viewing 0 reply threads
    Author
    Replies
    • #909819

      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.

      • #909838

        It is a nice answer .
        Thank u dear .
        Ashraf

        • #909924

          if i want the inverse write only numbers .

          • #909932

            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 [

            • #909940

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

            • #909941

              blush Sorry, had to use Or instead of And. I also add keyascii 8 to be able to use the backspace.

              If (KeyAscii 58) And KeyAscii 8 Then
              KeyAscii = 0
              End If

            • #909942

              blush Sorry, had to use Or instead of And. I also add keyascii 8 to be able to use the backspace.

              If (KeyAscii 58) And KeyAscii 8 Then
              KeyAscii = 0
              End If

          • #909933

            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 [

          • #909952

            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.

          • #909953

            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.

        • #909925

          if i want the inverse write only numbers .

      • #909839

        It is a nice answer .
        Thank u dear .
        Ashraf

    Viewing 0 reply threads
    Reply To: no numbers (2k)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: