Manipulating Form Properties

Topher

Registered User.
Local time
Today, 19:00
Joined
Apr 18, 2000
Messages
72
good day all,

im hoping someone knows how to manipulate the properties on forms thru VBA code??

the thing i want to do is change a few properties on ALL the forms in my DB - theres about 20 or so. i've bin able to figure out the code using collections to list all the names of the forms.

If dbContainer.name = "Forms" Then
For Each conDocument In dbContainer.Documents
Debug.Print conDocument.name
Set frm = conDocument.name
With frm
Debug.Print .Caption
End With
Next conDocument
End If

the debug.print gives me the list so i thought if i set a form variable with the name i could get to the properties. however i get an error about a type mismatch when i try to set the variable.

so is there a way to do this?? or do i have to go thru each form individually to change them??

- Topher
 
What about this:

DoCmd.OpenForm "FormName",acDesign

Then you could go on manipulating Forms!FormName!NameOfControl.

Haven't tried, just a hint.
Let me know if it works!
 
The problem with that is i'd have to put the name of the form in quotes - i have 40+ forms and if i add some later i dont want to have to keep adding lines of code to open the form - plus this would really slow things down b/c it opens all the forms one by one changes them and i guess i could close them afterwards.

thats why im trying to figure out how to do it all automatically thru code.

thanks anyways =)

i might have to just do that anyhow

- Topher
 

Users who are viewing this thread

Back
Top Bottom