S
Stuart Conner via AccessMonster.com
I'm trying to set some properties such as the BorderStyle for all the forms in a project. I think I should be able to enumerate through the AllForms collection and set the properties for each form, but I'm having trouble.
I can enumerate through the forms OK by using the following code ...
Dim myForm As AccessObject
For Each myForm In Application.CurrentProject.AllForms
MsgBox myForm.Name 'Show form name just to prove it works
Next myForm
.... and I can open a form in the loop to set its properties by adding ...
DoCmd.OpenForm myForm.Name, acDesign, , , , acWindowNormal
.... but I can't use the form name (myForm.Name) in a Forms![]... statement - the statement either wants literally the name of the form or its index number in the Forms collection.
What am I doing wrong?
Thanks for any help,
Stuart Conner
I can enumerate through the forms OK by using the following code ...
Dim myForm As AccessObject
For Each myForm In Application.CurrentProject.AllForms
MsgBox myForm.Name 'Show form name just to prove it works
Next myForm
.... and I can open a form in the loop to set its properties by adding ...
DoCmd.OpenForm myForm.Name, acDesign, , , , acWindowNormal
.... but I can't use the form name (myForm.Name) in a Forms![]... statement - the statement either wants literally the name of the form or its index number in the Forms collection.
What am I doing wrong?
Thanks for any help,
Stuart Conner