I’m trying to find out how to programatically determine which fields on a form are Required. In a search of this forum I found a post http://www.wopr.com/cgi-bin/w3t/showflat.p…ew=&sb=&o=&vc=1 in which JAYDEN says:
“I like to use the ‘tag’ property of controls to indicate those controls that have ‘required’ data. I usually set the tag property for controls to 1 for required and 0 for optional (or sometimes leave it blank). During the beforeupdate event of the form, I just run code that loops through all controls, checks to see if the first character of the tag control is 1, if it is, it then checks to make sure that the field has a value. ”
________________________________________________________________
I would prefer not to have to remember to tag required fields that may be added to the form in the future if possible. Is there a way to loop through the fields, like:
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Then
‘TEST FOR REQUIRED PROPERTY
End If
Next ctl
________________________________________________________________
Thanks,
Randy