| | |
Validation function
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2005
Posts: 35
Reputation:
Solved Threads: 0
i have created a textbox, and if the user have enter an invalid value, the textbox must be able to check whether the value enter by the user is a string or an integer. I have set the CausesValidation to true. If i tried to enter a character, and the msgbox should appear "Is not an integer" but instead i got an error message that says "compile error : Method or data member not found " . I doesn't understand why does this error message keep pop out. Please explain where it went wrong.
Private Sub Text2_Validate(Index As Integer, Cancel As Boolean)
If IsNumeric(Text2.Text) = False Then
MsgBox "Is not an integer"
Cancel = True
End If
End Sub Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Command1_Click() If IsNumeric(Text1.Text) = False Then MsgBox "Is not an integer" Exit Sub End If MsgBox "Ok" End Sub
pG
![]() |
Similar Threads
- Any Sample Program??? (C++)
- Sorted linked list help (C++)
- preg_match validation (PHP)
- Automatic email creation in cpanel ----PHP (PHP)
- Mailform error (PHP)
- form validation_valkue retaining and changing the color of the labe not entered (HTML and CSS)
- how to validate checkbox with different names? (HTML and CSS)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: TMP files...
- Next Thread: how I chang radio button selection ?
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





