E
Eric.I.Feurich
Dear all,
I'm trying to validate if information has been added in to textboxes and
combo boxes.
Private Function CheckValues() As Boolean
'**************************************************
'***
'*** Function : CheckValues()
'*** Purpose : Check if all values as filled -in
'***
'***
'***
'****************************************************
Dim frmMain As New frmMain '*** Instance of the Main form
Dim ctrl As New Control '*** Instance of the systems control object
With frmMain
For Each ctrl In .Controls
If TypeOf ctrl Is TextBox Or TypeOf ctrl Is ComboBox Then
If ctrl.Text = "" Then
CheckValues = False
Exit Function
End If
End If
Next
CheckValues = True
End With
End Function
This is what i have so far. But when in the function the ctrl.text property
is empty when in the form there is tekst in the control.
Is this because i am using an instance of the frmmain form ??
If i don't instanciate the frmmain form i can't acces the properties.
Does anyone know an answer on this??
GreetZ,
Eric
I'm trying to validate if information has been added in to textboxes and
combo boxes.
Private Function CheckValues() As Boolean
'**************************************************
'***
'*** Function : CheckValues()
'*** Purpose : Check if all values as filled -in
'***
'***
'***
'****************************************************
Dim frmMain As New frmMain '*** Instance of the Main form
Dim ctrl As New Control '*** Instance of the systems control object
With frmMain
For Each ctrl In .Controls
If TypeOf ctrl Is TextBox Or TypeOf ctrl Is ComboBox Then
If ctrl.Text = "" Then
CheckValues = False
Exit Function
End If
End If
Next
CheckValues = True
End With
End Function
This is what i have so far. But when in the function the ctrl.text property
is empty when in the form there is tekst in the control.
Is this because i am using an instance of the frmmain form ??
If i don't instanciate the frmmain form i can't acces the properties.
Does anyone know an answer on this??
GreetZ,
Eric