nirmalachr
New Member
- Joined
- Nov 25, 2013
- Messages
- 26
Hi,
The below code i had used to validate the data entered in corresponding fields but the code is not working only numeric condition is working and i had added data validation at the end of the command button before last line.
Private Sub datavalidation()
If Not IsNumeric(TextBox3.Value) Then
MsgBox "Amount Field can not be blank"
Exit Sub
End If
If TextBox2.Value = "" Then
MsgBox "Please enter the type of Proposal"
Exit Sub
End If
If TextBox1.Value = "" Then
MsgBox ("Sorry, you need to provide an Amount")
TextBox1.SetFocus
Exit Sub
End If
'If TextBox1.Value = " " Then
'MsgBox "Please enter the Applicant Name"
'Exit Sub
'End If
If ComboBox1.Value = "" Then
MsgBox "Sorry, You need to select Branch Code"
Exit Sub
End If
If ComboBox2.Value = "" Then
MsgBox "Sorry, You need to select Branch Name"
Exit Sub
End If
If ComboBox3.Value = "" Then
MsgBox "Sorry, You need to select The Proposar Status"
Exit Sub
End If
If ComboBox4.Value = "" Then
MsgBox "Sorry, You need to select Dealing Officer"
Exit Sub
End If
If ComboBox5.Value = "" Then
MsgBox "Sorry, You need to select The Disposal"
Exit Sub
End If
End Sub
Please help me if my program is worng
The below code i had used to validate the data entered in corresponding fields but the code is not working only numeric condition is working and i had added data validation at the end of the command button before last line.
Private Sub datavalidation()
If Not IsNumeric(TextBox3.Value) Then
MsgBox "Amount Field can not be blank"
Exit Sub
End If
If TextBox2.Value = "" Then
MsgBox "Please enter the type of Proposal"
Exit Sub
End If
If TextBox1.Value = "" Then
MsgBox ("Sorry, you need to provide an Amount")
TextBox1.SetFocus
Exit Sub
End If
'If TextBox1.Value = " " Then
'MsgBox "Please enter the Applicant Name"
'Exit Sub
'End If
If ComboBox1.Value = "" Then
MsgBox "Sorry, You need to select Branch Code"
Exit Sub
End If
If ComboBox2.Value = "" Then
MsgBox "Sorry, You need to select Branch Name"
Exit Sub
End If
If ComboBox3.Value = "" Then
MsgBox "Sorry, You need to select The Proposar Status"
Exit Sub
End If
If ComboBox4.Value = "" Then
MsgBox "Sorry, You need to select Dealing Officer"
Exit Sub
End If
If ComboBox5.Value = "" Then
MsgBox "Sorry, You need to select The Disposal"
Exit Sub
End If
End Sub
Please help me if my program is worng