Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Input masks

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Where the wild roses grow
    Posts
    285
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I am designing a form and in one of the text boxes I would like to have something like an input mask, like the ones used in Access. Basically I need all the users to put in a seven digit number. If they dont and put a six digit or eight digit etc, then I need a msgbox to appear saying "This field needs to contain seven digits"

    Can anyone help?

    [ This Message was edited by: Audiojoe on 2002-03-07 08:45 ]

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Keaau, Hawaii
    Posts
    238
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-07 08:17, Audiojoe wrote:
    I am designing a form and in one of the text boxes I would like to have something like an input mask, like the ones used in Access. Basically I need all the users to put in a seven digit number. If they dont and put a six digit or eight digit etc, then I need a msgbox to appear saying "This field needs to contain seven digits"

    Can anyone help?

    [ This Message was edited by: Audiojoe on 2002-03-07 08:45 ]
    Option Explicit


    Dim MyStr1 As String, MyLen

    Sub DetermineLength()
    MyStr1 = InputBox("Insert Seven Digits")
    MyLen = Len(MyStr1)
    If MyLen <> 7 Then
    MsgBox ("not 7 digits")
    Range("A1").Value = ""
    Else
    MsgBox ("Cool")
    Range("A1").Value = MyStr1
    End If


    End Sub

  3. #3
    Guest

    Default

    As an alternative, if you don't require a text box, you can use data validation to specify the text length in an individual cell. On the data menu select validation, for a validation criteria select text length, then set the minimum and maximum length for 7.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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