Data validation 
Author Message
 Data validation


what is the best way to see if all the textboxes on a form have text
i would like to exclude some of the textboxes, so code like this :

Public Function Validate(frmForm As Form) As boolean

    Dim SomeCtl As Control

    For Each SomeCtl In frmForm.Controls
        If TypeOf SomeCtl Is TextBox then
            If SomeCtl.Text = "" Then Exit Function
        End If
    Next Control

    Validate = true

End Function

checks all the textboxes.

writing a Validate Function for every form seems a bit to much for me
there has to be a universal solution to this (one that gets the names of the
textboxes who may be empty )

i also want to be able to add and remove textboxes from this validation so
the user can choose at runtime wich fields have to be filled

has anyone have a good solution for this


Sat, 02 Sep 2000 03:00:00 GMT  
 Data validation

Put something in the Tag property of the text box to say whether entry is
mandatory or not. Make your check routine act on this information.

Simon Jones
PC Pro Magazine

Sat, 02 Sep 2000 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Data Validation with ADO and Data Grid

2. Problems with a user input data validation module

3. Having Trouble w/Data Validation Code (Acc97)

4. Data Validation

5. A little help -data validation - transrollback

6. Data Validation and Combo Box Questions

7. Data validation technique ...Help .....

8. Data Validation (Newbie)

9. Data validation as you type - technique..

10. I don't get data validation

11. Data Validation in VB5

12. Data Validation - VB3/Access2.0


Powered by phpBB® Forum Software