Properties Window in VBE - How Do I Print It?

wilderfan

Registered User.
Local time
Yesterday, 21:37
Joined
Mar 3, 2008
Messages
172
Is there a way to print out the complete properties window of a form or report from the VBE window ?

I know it is possible to print the code, but it would be useful to be able to print all the properties settings for a form and compare forms to see if settings are similar or different.
 
The properties of a form is a collection.
The code below writes every propertyname and value to the immediate window.
You can use it to compare properties of two(or more) forms
Code:
Private Sub Command0_Click()

    Dim prp As Property
    
    For Each prp In Me.Properties
        Debug.Print prp.Name & " = " & Nz(prp.Value, "")
    Next prp

End Sub
 
Thanks.

I'll give that a try.
 
I assume that I need to create a command button on the form.

I've done that.

As for the code, does it need to be placed in the Declarations section of the VBA code for the form?
 
Can't seem to get anything to show up in the immediate window.

I placed the suggested code into the form module.

Then I copied the name of the procedure into the immediate window (cmdProperties_Click) and hit "enter".

The error message said: Compile error: Sub or Function not defined.

Any suggestions?
 
Because you want to list all the properties of a form, to keep it simple, this code needs to be part of the form. Create a button on the form. By default the name of the button is Command0. The code is have given you is the code which will be executed when the command button is pressed.
Because the event driven procedures are private to the form, you can't execute the code in the immediate window.

Just run the form and press the button.
check out the immediate window, voila.

HTH:D
 

Users who are viewing this thread

Back
Top Bottom