home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,147 of 10,840   
   edoepke to hennie   
   Re: TextBox Error   
   14 Jan 05 14:42:33   
   
   From: edoepke@comcast.net   
      
   This will allow you to useboth positive and negative numbers and decimal   
   points.   
      
   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(strText))   
   End Function   
      
   Hope this helps.   
      
      
   "hennie"  wrote in message   
   news:cs8ql0$ele$1@reader08.wxs.nl...   
   > Hello,   
   > I've define a TextBox As Byte. Only numeric can be the input. I have made   
   > a   
   > ErrorCheck().   
   > The problem next:   
   >   
   > If Val(Form1.txtText1.Text) "This is the problem" is not a byte Then   
   > etc.   
   >   
   > What do i have to fill in by: This is the problem is not a byte   
   >   
   > I have try <> Byte, but this doesn't work.   
   > I can the input define As String or something but I want only numeric that   
   > can input.   
   >   
   > Can someone help me, Thanks   
   >   
   >   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca