Hi!
I've got ~10 forms in a database, each with numerous (say 15) option buttons in frames.
Each is named [variable name]Frame, but I'd like to name them all to [variable name]YN to reflect their purpose.
Rather than renaming each by hand, is there a piece of VBA which will do this programatically?
I've tried...
...but I get 'Compile error: For Each may only iterate over a collection object or an array', highlighting .Name of...
Thanks!
Iain
I've got ~10 forms in a database, each with numerous (say 15) option buttons in frames.
Each is named [variable name]Frame, but I'd like to name them all to [variable name]YN to reflect their purpose.
Rather than renaming each by hand, is there a piece of VBA which will do this programatically?
I've tried...
Code:
Sub FormName()
Dim frm As Form
Dim ctl As Control
For Each frm In Forms
DoCmd.OpenForm frm.Name, acDesign
For Each ctl In frm.Name
ctl.Name = Replace(ctl.Name, "Frame", "YN")
Next
Next
End Sub
Code:
For Each ctl In frm.Name
Thanks!
Iain