One way would be to use the For..Each Statement to Enumerate all Textboxes on your Form(s), e.g.
If you want this functionality for all or a range of your Forms, put the Routine into a Public Sub in a Module and have it passed a Reference to the Form, eg.Code:Private Sub Form_Load() For Each Control In Me If TypeOf Control Is TextBox Then Control.Text = "Default Text" End If Next End Sub
The in each Forms Load Event use:Code:Public Sub SetDefaultProperties(ByRef oForm As Form) For Each Control In oForm If TypeOf Control Is TextBox Then Control.Text = "Default Text" End If Next End Sub
Code:Private Sub Form_Load() SetDefaultProperties Me End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]




Reply With Quote