how to compare properies sheets of two forms

  • Thread starter Thread starter Christopher Glaeser
  • Start date Start date
C

Christopher Glaeser

I had a problem with a form (Data Entry was set to Yes; should have been No)
that would have been much easier for me to isolate if I could have compared
the property sheets of two forms. I don't think Access will put two
property sheets on the screen at the same time, and I don't know how to
print a property sheet. Is there an easy way to compare two property
sheets?

Best,
Christopher
 
Christopher Glaeser said:
I had a problem with a form (Data Entry was set to Yes; should have
been No) that would have been much easier for me to isolate if I
could have compared the property sheets of two forms. I don't think
Access will put two property sheets on the screen at the same time,
and I don't know how to print a property sheet. Is there an easy way
to compare two property sheets?

You could use a procedure like the following to list each form's
properties to the Immediate Window, and then copy and paste the results
for each form into a separate text file for comparison, or into separate
Notepad windows for easy visual comparison.

'----- start of code -----
Sub ListFormProperties(FormName As String)

Dim frm As Form
Dim prp As Property
Dim blnCloseIt As Boolean

If Not CurrentProject.AllForms(FormName).IsLoaded Then
DoCmd.OpenForm FormName, acDesign
blnCloseIt = True
End If

Set frm = Forms(FormName)

On Error Resume Next

For Each prp In frm.Properties
Debug.Print prp.Name, prp.Value
Next prp

Set frm = Nothing

If blnCloseIt Then
DoCmd.Close acForm, FormName, acSaveNo
End If

End Sub
'----- end of code -----

Or you could use this code as a model to build a "CompareFormProperties"
function.

For a more complete comparison, you can use the undocumented
Application.SaveAsText function to save each form to a text file, and
then compare those two files. That'll give you a complete text
definition of each form.
 
Klatuu said:
verrrrryyyy interesting.....
looks very much like a SourceSafe representation of a form.

AIUI, SourceSafe uses Application.SaveAsText and
Application.LoadFromText to get/store Access objects.
 
:) That would explain why it looks so familiar :)
Now, is there a LoadFromText?
(you know what I'm thinking)
 
Klatuu said:
:) That would explain why it looks so familiar :)
Now, is there a LoadFromText?

Yes, as I said:

SaveAsText and LoadFromText are both undocumented methods of the Access
Application object, but if you type them in a code window (or the
Immediate Window), you'll get intellisense to guide you in their
arguments.
 
Yes, I did that. My previous question about the LoadFromText was stupid. I
was so excited I did not read your entire (although short) post.

Where I am going with that is, since I can't afford SourceSafe and the
powers that be wont pay for it, I might do a roll your own Version Control
routine.

Thanks again.
 
Klatuu said:
Where I am going with that is, since I can't afford SourceSafe and the
powers that be wont pay for it, I might do a roll your own Version
Control routine.

Sure, why not?
 
Back
Top