Trap Input

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nkp

    #1

    Trap Input

    Sorry guys, basic questions.....
    1)how do you prevent negative numeric input in a text box (-2345 etc)
    2)how do detect /prevent input of LESS than 8 characters in a text box(
    where a password must be a minimum of 8 characters for example)
    Thank you.

  • Rick Rothstein

    #2
    Re: Trap Input

    > Sorry guys, basic questions.....[color=blue]
    > 1)how do you prevent negative numeric input in a text box (-2345 etc)
    > 2)how do detect /prevent input of LESS than 8 characters in a text box(
    > where a password must be a minimum of 8 characters for example)
    > Thank you.[/color]

    When the user clicks on your OK, Next, Continue (or whatever caption you
    have) button, check the contents of the TextBox to see if it has the "shape"
    you want. If not, pop up a warning dialog box and, after the user clicks OK
    on it, take them back to the "offending" TextBox so they can correct their
    entry.

    Rick - MVP


    Comment

    • Raoul Watson

      #3
      Re: Trap Input


      "nkp" <weatheredwall@ btinternet.com> wrote in message
      news:bm99ln$o72 $1@sparta.btint ernet.com...[color=blue]
      > Sorry guys, basic questions.....
      > 1)how do you prevent negative numeric input in a text box (-2345 etc)
      > 2)how do detect /prevent input of LESS than 8 characters in a text box(
      > where a password must be a minimum of 8 characters for example)
      > Thank you.
      >[/color]

      1.
      YOUR SUB

      IF VAL(TRIM(Text1. Text)) >= 0 THEN
      'handle valid numerical entry
      ELSE
      'let user know, e.g
      MSGBOX("non-negative numbers only please")
      END IF

      IF LEN(TRIM(Text1. Text)) > 7 THEN
      ' valid user password
      ELSE
      ' let user know. Might need a counter here
      ' like if it exceed 3 to quit the program or
      ' something like that
      MSGBOX("Incorre ct password. try again.")
      END IF




      Comment

      • MooVBuff

        #4
        Re: Trap Input

        'Positive numbers only:
        Private Sub Text1_Change()
        If Not IsNumeric(Text1 .Text) Then
        Text1.Text = ""
        End If
        End Sub

        Often, to ensure that users enter only numbers in a text field, you'll want
        to validate the text as they enter it. The textbox's Change() event provides
        the best place to do so. However, simply using the IsNumeric() function
        alone won't do the trick. For instance, suppose the user entered a negative
        number. The IsNumeric() function simply wont see it and will return an
        error. There is a way around this.


        Private Sub Text1_Change()
        If Not ValidateNumeric (Text1.Text) Then
        Text1.Text = ""
        End If
        End Sub

        Private Function ValidateNumeric (strText As String) _
        As Boolean
        ValidateNumeric = CBool(strText = "" _
        Or strText = "-" _
        Or strText = "-." _
        Or strText = "." _
        Or IsNumeric(strTe xt))
        End Function


        "nkp" <weatheredwall@ btinternet.com> wrote in message
        news:bm99ln$o72 $1@sparta.btint ernet.com...[color=blue]
        > Sorry guys, basic questions.....
        > 1)how do you prevent negative numeric input in a text box (-2345 etc)
        > 2)how do detect /prevent input of LESS than 8 characters in a text box(
        > where a password must be a minimum of 8 characters for example)
        > Thank you.
        >[/color]


        Comment

        • nkp

          #5
          Re: Trap Input

          Thanks Raoul....just what I needed!


          Raoul Watson wrote:
          [color=blue]
          > "nkp" <weatheredwall@ btinternet.com> wrote in message
          > news:bm99ln$o72 $1@sparta.btint ernet.com...
          >[color=green]
          >>Sorry guys, basic questions.....
          >>1)how do you prevent negative numeric input in a text box (-2345 etc)
          >>2)how do detect /prevent input of LESS than 8 characters in a text box(
          >>where a password must be a minimum of 8 characters for example)
          >>Thank you.
          >>[/color]
          >
          >
          > 1.
          > YOUR SUB
          >
          > IF VAL(TRIM(Text1. Text)) >= 0 THEN
          > 'handle valid numerical entry
          > ELSE
          > 'let user know, e.g
          > MSGBOX("non-negative numbers only please")
          > END IF
          >
          > IF LEN(TRIM(Text1. Text)) > 7 THEN
          > ' valid user password
          > ELSE
          > ' let user know. Might need a counter here
          > ' like if it exceed 3 to quit the program or
          > ' something like that
          > MSGBOX("Incorre ct password. try again.")
          > END IF
          >
          >
          >
          >[/color]

          Comment

          • MooVBuff

            #6
            Re: Trap Input

            If Len(Text1.Text) < 8 then
            MsgBox ("Must be at least 8 characters")
            Text1.Text = ""
            End If


            "nkp" <weatheredwall@ btinternet.com> wrote in message
            news:bm99ln$o72 $1@sparta.btint ernet.com...[color=blue]
            > Sorry guys, basic questions.....
            > 1)how do you prevent negative numeric input in a text box (-2345 etc)
            > 2)how do detect /prevent input of LESS than 8 characters in a text box(
            > where a password must be a minimum of 8 characters for example)
            > Thank you.
            >[/color]


            Comment

            • Rick Rothstein

              #7
              Re: Trap Input

              I usually try and steer people away from using IsNumeric to "proof"
              supposedly numeric text. Consider this (also see note at end of post):

              ReturnValue = IsNumeric("($1, 23,,3.4,,,5,,E6 7$)")

              Most people would not expect THAT to return True. IsNumeric has some "flaws"
              in what it considers a proper number and what most programmers are looking
              for.

              I had a short tip published by Pinnacle Publishing in their Visual Basic
              Developer magazine that covered some of these flaws. Originally, the tip was
              free to view but is now viewable only by subscribers.. Basically, it said
              that IsNumeric returned True for things like -- currency symbols being
              located in front or in back of the number as shown in my example (also
              applies to plus, minus and blanks too); numbers surrounded by parentheses as
              shown in my example (some people use these to mark negative numbers);
              numbers containing any number of commas before a decimal point as shown in
              my example; numbers in scientific notation (a number followed by an upper or
              lower case "D" or "E", followed by a number equal to or less than 305 -- the
              maximum power of 10 in VB); and Octal/Hexadecimal numbers (&H for
              Hexadecimal, &O or just & in front of the number for Octal).

              NOTE:
              ======
              In the above example and in the referenced tip, I refer to $ signs and
              commas and dots -- these were meant to refer to your currency, thousands
              separator and decimal point symbols as defined in your local settings --
              substitute your local regional symbols for these if appropriate.

              As for your question about checking numbers, here are two functions that I
              have posted in the past for similar questions..... one is for digits only
              and the other is for "regular" numbers:

              Function IsDigitsOnly(Va lue As String) As Boolean
              IsDigitsOnly = Not Value Like "*[!0-9]*"
              End Function

              Function IsNumber(ByVal Value As String) As Boolean
              ' Leave the next statement out if you don't
              ' want to provide for plus/minus signs
              If Value Like "[+-]*" Then Value = Mid$(Value, 2)
              IsNumber = Not Value Like "*[!0-9.]*" And _
              Not Value Like "*.*.*" And _
              Len(Value) > 0 And Value <> "." And _
              Value <> vbNullString
              End Function


              Rick - MVP





              "MooVBuff" <edoepke@comcas t.net> wrote in message
              news:zuqcnTkbBc lP7hWiU-KYvg@comcast.co m...[color=blue]
              > 'Positive numbers only:
              > Private Sub Text1_Change()
              > If Not IsNumeric(Text1 .Text) Then
              > Text1.Text = ""
              > End If
              > End Sub
              >
              > Often, to ensure that users enter only numbers in a text field, you'll[/color]
              want[color=blue]
              > to validate the text as they enter it. The textbox's Change() event[/color]
              provides[color=blue]
              > the best place to do so. However, simply using the IsNumeric() function
              > alone won't do the trick. For instance, suppose the user entered a[/color]
              negative[color=blue]
              > number. The IsNumeric() function simply wont see it and will return an
              > error. There is a way around this.
              >
              >
              > Private Sub Text1_Change()
              > If Not ValidateNumeric (Text1.Text) Then
              > Text1.Text = ""
              > End If
              > End Sub
              >
              > Private Function ValidateNumeric (strText As String) _
              > As Boolean
              > ValidateNumeric = CBool(strText = "" _
              > Or strText = "-" _
              > Or strText = "-." _
              > Or strText = "." _
              > Or IsNumeric(strTe xt))
              > End Function
              >
              >
              > "nkp" <weatheredwall@ btinternet.com> wrote in message
              > news:bm99ln$o72 $1@sparta.btint ernet.com...[color=green]
              > > Sorry guys, basic questions.....
              > > 1)how do you prevent negative numeric input in a text box (-2345 etc)
              > > 2)how do detect /prevent input of LESS than 8 characters in a text box(
              > > where a password must be a minimum of 8 characters for example)
              > > Thank you.
              > >[/color]
              >
              >[/color]


              Comment

              • MooVBuff

                #8
                Re: Trap Input

                Well put. Thanks.

                "Rick Rothstein" <rickNOSPAMnews @NOSPAMcomcast. net> wrote in message
                news:8-icnaESOoCHTBWiU-KYjA@comcast.co m...[color=blue]
                > I usually try and steer people away from using IsNumeric to "proof"
                > supposedly numeric text. Consider this (also see note at end of post):
                >
                > ReturnValue = IsNumeric("($1, 23,,3.4,,,5,,E6 7$)")
                >
                > Most people would not expect THAT to return True. IsNumeric has some[/color]
                "flaws"[color=blue]
                > in what it considers a proper number and what most programmers are looking
                > for.
                >
                > I had a short tip published by Pinnacle Publishing in their Visual Basic
                > Developer magazine that covered some of these flaws. Originally, the tip[/color]
                was[color=blue]
                > free to view but is now viewable only by subscribers.. Basically, it said
                > that IsNumeric returned True for things like -- currency symbols being
                > located in front or in back of the number as shown in my example (also
                > applies to plus, minus and blanks too); numbers surrounded by parentheses[/color]
                as[color=blue]
                > shown in my example (some people use these to mark negative numbers);
                > numbers containing any number of commas before a decimal point as shown in
                > my example; numbers in scientific notation (a number followed by an upper[/color]
                or[color=blue]
                > lower case "D" or "E", followed by a number equal to or less than 305 --[/color]
                the[color=blue]
                > maximum power of 10 in VB); and Octal/Hexadecimal numbers (&H for
                > Hexadecimal, &O or just & in front of the number for Octal).
                >
                > NOTE:
                > ======
                > In the above example and in the referenced tip, I refer to $ signs and
                > commas and dots -- these were meant to refer to your currency, thousands
                > separator and decimal point symbols as defined in your local settings --
                > substitute your local regional symbols for these if appropriate.
                >
                > As for your question about checking numbers, here are two functions that I
                > have posted in the past for similar questions..... one is for digits only
                > and the other is for "regular" numbers:
                >
                > Function IsDigitsOnly(Va lue As String) As Boolean
                > IsDigitsOnly = Not Value Like "*[!0-9]*"
                > End Function
                >
                > Function IsNumber(ByVal Value As String) As Boolean
                > ' Leave the next statement out if you don't
                > ' want to provide for plus/minus signs
                > If Value Like "[+-]*" Then Value = Mid$(Value, 2)
                > IsNumber = Not Value Like "*[!0-9.]*" And _
                > Not Value Like "*.*.*" And _
                > Len(Value) > 0 And Value <> "." And _
                > Value <> vbNullString
                > End Function
                >
                >
                > Rick - MVP
                >
                >
                >
                >
                >
                > "MooVBuff" <edoepke@comcas t.net> wrote in message
                > news:zuqcnTkbBc lP7hWiU-KYvg@comcast.co m...[color=green]
                > > 'Positive numbers only:
                > > Private Sub Text1_Change()
                > > If Not IsNumeric(Text1 .Text) Then
                > > Text1.Text = ""
                > > End If
                > > End Sub
                > >
                > > Often, to ensure that users enter only numbers in a text field, you'll[/color]
                > want[color=green]
                > > to validate the text as they enter it. The textbox's Change() event[/color]
                > provides[color=green]
                > > the best place to do so. However, simply using the IsNumeric() function
                > > alone won't do the trick. For instance, suppose the user entered a[/color]
                > negative[color=green]
                > > number. The IsNumeric() function simply wont see it and will return an
                > > error. There is a way around this.
                > >
                > >
                > > Private Sub Text1_Change()
                > > If Not ValidateNumeric (Text1.Text) Then
                > > Text1.Text = ""
                > > End If
                > > End Sub
                > >
                > > Private Function ValidateNumeric (strText As String) _
                > > As Boolean
                > > ValidateNumeric = CBool(strText = "" _
                > > Or strText = "-" _
                > > Or strText = "-." _
                > > Or strText = "." _
                > > Or IsNumeric(strTe xt))
                > > End Function
                > >
                > >
                > > "nkp" <weatheredwall@ btinternet.com> wrote in message
                > > news:bm99ln$o72 $1@sparta.btint ernet.com...[color=darkred]
                > > > Sorry guys, basic questions.....
                > > > 1)how do you prevent negative numeric input in a text box (-2345 etc)
                > > > 2)how do detect /prevent input of LESS than 8 characters in a text[/color][/color][/color]
                box([color=blue][color=green][color=darkred]
                > > > where a password must be a minimum of 8 characters for example)
                > > > Thank you.
                > > >[/color]
                > >
                > >[/color]
                >
                >[/color]


                Comment

                • Steve Gerrard

                  #9
                  Re: Trap Input

                  Hope you don't mind a slight digression, and an invitation to comment.

                  I have found that users expect a number as displayed to also be acceptable as
                  input. For instance, if a number is displayed as $1,254 and the use edits it to
                  read $1,243 they expect this edited version to be accepted. This is particularly
                  a problem for me because our apps tend to have a lot of feet inch, and angle
                  measurements, and display things like 49.75" or 37.75' or 15.23° - or even N 27°
                  13' 42" E.

                  While less elegant that the use of Like (which I hadn't used in this kind of
                  situation, thanks for the idea), I have usually gone in the direction of
                  stripping the input text to the characters "0123456789-.", like this:

                  strTemp = ""
                  nCnt = Len(InputString )

                  For n = 1 To nCnt
                  strChar = Mid(InputString , n, 1)
                  If InStr(1, "0123456789-.", strChar, vbBinaryCompare ) Then
                  strTemp = strTemp & strChar
                  End If
                  Next n

                  Then either returning true if the result is numeric (i.e. IsNumeric(strTe mp)),
                  or more often, applying the appropriate format, whether currency, feet, inches,
                  angle, or whatever, and displaying that.

                  By the way, rather than msgboxing the user, I usually just restore the previous
                  value if the user's new entry is no good.

                  "Rick Rothstein" <rickNOSPAMnews @NOSPAMcomcast. net> wrote in message
                  news:8-icnaESOoCHTBWiU-KYjA@comcast.co m...[color=blue]
                  > I usually try and steer people away from using IsNumeric to "proof"
                  > supposedly numeric text. Consider this (also see note at end of post):
                  >
                  > ReturnValue = IsNumeric("($1, 23,,3.4,,,5,,E6 7$)")
                  >
                  > Most people would not expect THAT to return True. IsNumeric has some "flaws"
                  > in what it considers a proper number and what most programmers are looking
                  > for.
                  >
                  > I had a short tip published by Pinnacle Publishing in their Visual Basic
                  > Developer magazine that covered some of these flaws. Originally, the tip was
                  > free to view but is now viewable only by subscribers.. Basically, it said
                  > that IsNumeric returned True for things like -- currency symbols being
                  > located in front or in back of the number as shown in my example (also
                  > applies to plus, minus and blanks too); numbers surrounded by parentheses as
                  > shown in my example (some people use these to mark negative numbers);
                  > numbers containing any number of commas before a decimal point as shown in
                  > my example; numbers in scientific notation (a number followed by an upper or
                  > lower case "D" or "E", followed by a number equal to or less than 305 -- the
                  > maximum power of 10 in VB); and Octal/Hexadecimal numbers (&H for
                  > Hexadecimal, &O or just & in front of the number for Octal).
                  >
                  > NOTE:
                  > ======
                  > In the above example and in the referenced tip, I refer to $ signs and
                  > commas and dots -- these were meant to refer to your currency, thousands
                  > separator and decimal point symbols as defined in your local settings --
                  > substitute your local regional symbols for these if appropriate.
                  >
                  > As for your question about checking numbers, here are two functions that I
                  > have posted in the past for similar questions..... one is for digits only
                  > and the other is for "regular" numbers:
                  >
                  > Function IsDigitsOnly(Va lue As String) As Boolean
                  > IsDigitsOnly = Not Value Like "*[!0-9]*"
                  > End Function
                  >
                  > Function IsNumber(ByVal Value As String) As Boolean
                  > ' Leave the next statement out if you don't
                  > ' want to provide for plus/minus signs
                  > If Value Like "[+-]*" Then Value = Mid$(Value, 2)
                  > IsNumber = Not Value Like "*[!0-9.]*" And _
                  > Not Value Like "*.*.*" And _
                  > Len(Value) > 0 And Value <> "." And _
                  > Value <> vbNullString
                  > End Function
                  >
                  >
                  > Rick - MVP
                  >
                  >
                  >
                  >
                  >
                  > "MooVBuff" <edoepke@comcas t.net> wrote in message
                  > news:zuqcnTkbBc lP7hWiU-KYvg@comcast.co m...[color=green]
                  > > 'Positive numbers only:
                  > > Private Sub Text1_Change()
                  > > If Not IsNumeric(Text1 .Text) Then
                  > > Text1.Text = ""
                  > > End If
                  > > End Sub
                  > >
                  > > Often, to ensure that users enter only numbers in a text field, you'll[/color]
                  > want[color=green]
                  > > to validate the text as they enter it. The textbox's Change() event[/color]
                  > provides[color=green]
                  > > the best place to do so. However, simply using the IsNumeric() function
                  > > alone won't do the trick. For instance, suppose the user entered a[/color]
                  > negative[color=green]
                  > > number. The IsNumeric() function simply wont see it and will return an
                  > > error. There is a way around this.
                  > >
                  > >
                  > > Private Sub Text1_Change()
                  > > If Not ValidateNumeric (Text1.Text) Then
                  > > Text1.Text = ""
                  > > End If
                  > > End Sub
                  > >
                  > > Private Function ValidateNumeric (strText As String) _
                  > > As Boolean
                  > > ValidateNumeric = CBool(strText = "" _
                  > > Or strText = "-" _
                  > > Or strText = "-." _
                  > > Or strText = "." _
                  > > Or IsNumeric(strTe xt))
                  > > End Function
                  > >
                  > >
                  > > "nkp" <weatheredwall@ btinternet.com> wrote in message
                  > > news:bm99ln$o72 $1@sparta.btint ernet.com...[color=darkred]
                  > > > Sorry guys, basic questions.....
                  > > > 1)how do you prevent negative numeric input in a text box (-2345 etc)
                  > > > 2)how do detect /prevent input of LESS than 8 characters in a text box(
                  > > > where a password must be a minimum of 8 characters for example)
                  > > > Thank you.
                  > > >[/color]
                  > >
                  > >[/color]
                  >
                  >[/color]


                  Comment

                  • Rick Rothstein

                    #10
                    Re: Trap Input

                    > I have found that users expect a number as displayed to also be acceptable
                    as[color=blue]
                    > input. For instance, if a number is displayed as $1,254 and the use edits[/color]
                    it to[color=blue]
                    > read $1,243 they expect this edited version to be accepted. This is[/color]
                    particularly[color=blue]
                    > a problem for me because our apps tend to have a lot of feet inch, and[/color]
                    angle[color=blue]
                    > measurements, and display things like 49.75" or 37.75' or 15.23° - or even[/color]
                    N 27°[color=blue]
                    > 13' 42" E.[/color]

                    Usually what I do for things like currency or dimensioned items (not your
                    last direction example though), is to display it with the proper formating,
                    but remove the special characters and display only the numbers when they
                    click into the TextBox (using its GotFocus event) to edit it. Then, when the
                    TextBox loses focus, I check the number and display it with proper
                    fomatting, if valid, or indicate it is not valid in some way otherwise.

                    [color=blue]
                    > While less elegant that the use of Like (which I hadn't used in this kind[/color]
                    of[color=blue]
                    > situation, thanks for the idea), I have usually gone in the direction of
                    > stripping the input text to the characters "0123456789-.", like this:
                    >
                    > strTemp = ""
                    > nCnt = Len(InputString )
                    >
                    > For n = 1 To nCnt
                    > strChar = Mid(InputString , n, 1)
                    > If InStr(1, "0123456789-.", strChar, vbBinaryCompare ) Then
                    > strTemp = strTemp & strChar
                    > End If
                    > Next n
                    >
                    > Then either returning true if the result is numeric (i.e.[/color]
                    IsNumeric(strTe mp)),[color=blue]
                    > or more often, applying the appropriate format, whether currency, feet,[/color]
                    inches,[color=blue]
                    > angle, or whatever, and displaying that.[/color]

                    Wouldn't this allow them to type in complete garbage (perhaps an assumed
                    value in the clipboard that was not actually copied into there) and have
                    your program accept it as if it's valid? For example, if I entered this into
                    the TextBox, "H1EL2LO3", your program would assume I meant 123 and process
                    it.

                    [color=blue]
                    > By the way, rather than msgboxing the user, I usually just restore the[/color]
                    previous[color=blue]
                    > value if the user's new entry is no good.[/color]

                    You don't give them a signal that their entry was wrong? An argument can be
                    made for leaving the input as the user originally typed it... it makes it
                    easier for them to correct maybe one bad or incorrect character than type
                    the entire entry over again.


                    Rick - MVP


                    Comment

                    • Steve Gerrard

                      #11
                      Re: Trap Input

                      Thanks for the comments, Rick. I made a few comments in line, and I may pursue
                      this more at work, when I get time...

                      "Rick Rothstein" <rickNOSPAMnews @NOSPAMcomcast. net> wrote in message
                      news:l_SdndG_0M u53hGiU-KYgw@comcast.co m...[color=blue][color=green]
                      > > I have found that users expect a number as displayed to also be acceptable[/color]
                      > as[color=green]
                      > > input. For instance, if a number is displayed as $1,254 and the use edits[/color]
                      > it to[color=green]
                      > > read $1,243 they expect this edited version to be accepted. This is[/color]
                      > particularly[color=green]
                      > > a problem for me because our apps tend to have a lot of feet inch, and[/color]
                      > angle[color=green]
                      > > measurements, and display things like 49.75" or 37.75' or 15.23° - or even[/color]
                      > N 27°[color=green]
                      > > 13' 42" E.[/color]
                      >
                      > Usually what I do for things like currency or dimensioned items (not your
                      > last direction example though), is to display it with the proper formating,
                      > but remove the special characters and display only the numbers when they
                      > click into the TextBox (using its GotFocus event) to edit it. Then, when the
                      > TextBox loses focus, I check the number and display it with proper
                      > fomatting, if valid, or indicate it is not valid in some way otherwise.
                      >[/color]

                      This would work, I think, except for the angles and bearings in degrees,
                      minutes, seconds. Those are their own kind of pain in the neck. It would
                      also let them see a few more decimal places in certain situations, which
                      would help, as long as its not too many decimal places.
                      [color=blue]
                      >[color=green]
                      > > While less elegant that the use of Like (which I hadn't used in this kind[/color]
                      > of[color=green]
                      > > situation, thanks for the idea), I have usually gone in the direction of
                      > > stripping the input text to the characters "0123456789-.", like this:
                      > >
                      > > strTemp = ""
                      > > nCnt = Len(InputString )
                      > >
                      > > For n = 1 To nCnt
                      > > strChar = Mid(InputString , n, 1)
                      > > If InStr(1, "0123456789-.", strChar, vbBinaryCompare ) Then
                      > > strTemp = strTemp & strChar
                      > > End If
                      > > Next n
                      > >
                      > > Then either returning true if the result is numeric (i.e.[/color]
                      > IsNumeric(strTe mp)),[color=green]
                      > > or more often, applying the appropriate format, whether currency, feet,[/color]
                      > inches,[color=green]
                      > > angle, or whatever, and displaying that.[/color]
                      >
                      > Wouldn't this allow them to type in complete garbage (perhaps an assumed
                      > value in the clipboard that was not actually copied into there) and have
                      > your program accept it as if it's valid? For example, if I entered this into
                      > the TextBox, "H1EL2LO3", your program would assume I meant 123 and process
                      > it.
                      >[/color]

                      Yes it would. Fortunately, they mostly type in almost correct things, making
                      your next comment more important. Also, they copy and paste formatted
                      numbers from one text box to another, although I think the GotFocus
                      treatment you mentioned above would prevent them copying and pasting
                      formatted numbers.
                      [color=blue]
                      >[color=green]
                      > > By the way, rather than msgboxing the user, I usually just restore the[/color]
                      > previous[color=green]
                      > > value if the user's new entry is no good.[/color]
                      >
                      > You don't give them a signal that their entry was wrong? An argument can be
                      > made for leaving the input as the user originally typed it... it makes it
                      > easier for them to correct maybe one bad or incorrect character than type
                      > the entire entry over again.
                      >[/color]

                      True enough. Mostly the numbers are short enough that its not much of a
                      problem to re-enter them, and they seem to notice right away if an entry
                      didn't take. I am reluctant to actually trap them in the textbox until its
                      fixed, because they made need to view some other thing first. Maybe I can
                      leave the text they entered, make it red or something, and not save until it
                      gets fixed.
                      [color=blue]
                      >
                      > Rick - MVP
                      >
                      >[/color]

                      Steve


                      Comment

                      Working...