Click here to Skip to main content
16,020,669 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I using the under mention command to control on Zero/Blank Field at the time of storage of data.

CType(IIf(txttotal.Text = "", 0, txttotal.Text), String)

But is it possible that the cursor will not allow to move next on untill checking of data.

Else we have second option to done like that on each text

Private Function IsDataValid(ByVal InputData As String) As Boolean        'Return true if the input data is numeric.        
If Not IsNumeric(InputData) Then 
       ErrorProvider1.SetError(txtpatient_age, "Invalid age")            Label1.Visible = True        
Else            
Label1.Visible = False            
ErrorProvider1.Clear()          
End If   
End Function 


Major problem occurs when we have more than 25 Text box and want to valid date each of them.

[edit]Title - DON'T SHOUT! - OriginalGriff[/edit]
Posted
Updated 12-Sep-10 6:37am
v3

1 solution

Handle the TextBox.Validating event, and set e.Cancel to true if the content is not valid. The cursor will then be unable to leave the textbox.
 
Share this answer
 
Comments
Jatinder Gupta 12-Sep-10 21:06pm    
kindly explain with an example to move next

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900