A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Which query is being used by which form/report?



 
 
Thread Tools Display Modes
  #1  
Old October 12th, 2007, 02:46 AM posted to microsoft.public.access.forms
Dean Slindee
external usenet poster
 
Posts: 32
Default Which query is being used by which form/report?

Is there any way to find out whether a query is being used, and by which
reports or forms?

Thanks,
Dean S

  #2  
Old October 12th, 2007, 03:04 AM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default Which query is being used by which form/report?

This will list the RecordSource property of your forms and reports:

Public Function ShowSources()
Dim accObj As AccessObject
Dim strDoc As String

For Each accObj In CurrentProject.AllForms
strDoc = accObj.Name
DoCmd.OpenForm strDoc, acDesign, WindowMode:=acHidden
Debug.Print strDoc, Forms(strDoc).RecordSource
DoCmd.Close acForm, strDoc
Next

For Each accObj In CurrentProject.AllReports
strDoc = accObj.Name
DoCmd.OpenReport strDoc, acDesign, WindowMode:=acHidden
Debug.Print strDoc, Reports(strDoc).RecordSource
DoCmd.Close acReport, strDoc
Next
End Function

If you are interested in tracking down where a particular field is used,
this code will do it:
http://allenbrowne.com/ser-73.html

There's also a utility by Chas Dillon to rename fields and trace
dependencies he
http://allenbrowne.com/ser-41.html

Access 2003 and 2007 have the ability to trace dependencies, but that relies
on Name AutoCorrect. My experience is that where there are some invalid
sources (e.g. referring to fields/tables that no longer exist in the
database), it just crashes Access so is not usable.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Dean Slindee" wrote in message
...
Is there any way to find out whether a query is being used, and by which
reports or forms?

Thanks,
Dean S


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.