I'm not sure what code you're referring to, but here's some code that might get you going, anyway. These are two procedures I place in a module and use to change the properties of selected textboxes on all forms at once. The first sets an input mask and format for all textboxes with 'date' in their name. The second does the same for all textboxes with 'phone' in their name. This allows me to set or change properties for all controls of a particular type on all my forms, all in one fell swoop.
The modifications to merely modify some properties on all forms should be pretty simple.
(Setting format and input mask in design view of the table do what my procedures to, to some extent, but that method is limited because the values entered in table design are only used when a control for the field is placed on a form. If you change things later you need to reinsert the control or edit properties manually. -- Herb
---------------------------------------------------------
Public Sub ChangeDates()
On Error GoTo Err_cmd
Dim frmCollection As Object
Set frmCollection = CurrentProject.AllForms
Dim ctl As Control
Dim frm As Object
For Each frm In frmCollection
DoCmd.OpenForm frm.Name, acDesign
For Each ctl In Forms(frm.Name).Controls
If ctl.ControlType = acTextBox Then
If ctl.Name Like "*date*" Then
Debug.Print ctl.Name
ctl.InputMask = "99/99/00;;#"
ctl.Format = "mm/dd/yy"
End If
End If
'Debug.Print ctl.ControlType
Next ctl
DoCmd.Close acForm, frm.Name
Next frm
Exit_Sub:
Exit Sub
Err_cmd:
MsgBox Err.Description
Resume Exit_Sub
End Sub
-------------------------------------
Public Sub ChangePhones()
On Error GoTo Err_cmd
Dim frmCollection As Object
Set frmCollection = CurrentProject.AllForms
Dim ctl As Control
Dim frm As Object
For Each frm In frmCollection
DoCmd.OpenForm frm.Name, acDesign
For Each ctl In Forms(frm.Name).Controls
If ctl.ControlType = acTextBox Then
If ctl.Name Like "*phone*" Then
Debug.Print ctl.Name
ctl.InputMask = "!(999) 000-0000;;#"
'ctl.Format = "mm/dd/yy"
End If
End If
Next ctl
DoCmd.Close acForm, frm.Name
Next frm
Exit_Sub:
Exit Sub
Err_cmd:
MsgBox Err.Description
Resume Exit_Sub
End Sub
-----------------------------------------------------------