|
 |
access thread: Re: Where a query is being used as recordsource.
Message #1 by "Mavin Specimen" <mspecimen@h...> on Wed, 17 Oct 2001 17:04:24
|
|
Is there a way to find out where a query is being used as a recordsource,
such as a combox, listbox, or textbox, without looking at the properties
of each individual one in the project. I didn't create this project and
thought this was a good question to ask.
Thoughts/comments.
Message #2 by "Pardee, Roy E" <roy.e.pardee@l...> on Wed, 17 Oct 2001 10:30:55 -0700
|
|
I don't believe there is any easy way. I once started to write some procs
to do this & found it to be more difficult than my measly attention span
could tolerate... 8^) There are third-party products that will do this for
you (FMS Total Access Analyzer is one of them--I've never used any & so
can't advise).
HTH,
-Roy
Roy Pardee
Programmer/Analyst
SWFPAC Lockheed Martin IT
(360)
Message #3 by Brian Skelton <brian.skelton@b...> on Wed, 17 Oct 2001 21:53:19 +0100
|
|
This is crude, but should work. It's written for DAO rather than ADO, so
ensure your references are correct.
You'll end up with a massive table, with loads of blank lines (where
it's describing labels and tab controls). But it will also contain the
information you're interested in.
Create a table called tblAllForms. Create fields called fldForm,
fldControl, fldRowSource,fldControlSource.
Open all the forms in your database (in design mode)
Run the following code
Sub DescribeForms()
Dim frm As Form, ctl As Control
Dim Form As Forms
Dim rst As Recordset
Dim myDB As Database
'Next line is important as we'll be producing errors all over the place
On Error Resume Next
Set myDB =3D CurrentDb
Set rst =3D myDB.OpenRecordset("tblAllForms", dbOpenTable)
' Enumerate Forms collection.
For Each frm In Forms
rst.AddNew
rst.Fields("fldForm") =3D frm.Name
rst.Fields("fldControl") =3D frm.Name
rst.Fields("fldRowSource") =3D frm.RecordSource
rst.Update
' Enumerate Controls collection of each form.
For Each ctl In frm.Controls
rst.AddNew
rst.Fields("fldForm") =3D frm.Name
rst.Fields("fldControl") =3D ctl.Name
rst.Fields("fldRowSource") =3D ctl.RowSource
rst.Fields("fldControlSource") =3D ctl.RowSource
rst.Update
Next ctl
Next frm
rst.Close
End Sub
|
|
 |