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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Finding a function call in queries



 
 
Thread Tools Display Modes
  #1  
Old May 6th, 2010, 11:57 PM posted to microsoft.public.access.queries
cherman
external usenet poster
 
Posts: 25
Default Finding a function call in queries

Does anyone know of a way to find if a function is being called from a query?
Another words, I have a function that might be called from 1 or more queries
in my DB and I am looking for a quick way to see which queries it is called
from.

With over 200 queries in my DB, it will take me some time to check them
manually, and I have 2 functions to check.

Is there a utility or something that will do this for me?

Thanks!
  #2  
Old May 7th, 2010, 12:55 AM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Finding a function call in queries

On Thu, 6 May 2010 15:57:01 -0700, cherman
wrote:

Does anyone know of a way to find if a function is being called from a query?
Another words, I have a function that might be called from 1 or more queries
in my DB and I am looking for a quick way to see which queries it is called
from.

With over 200 queries in my DB, it will take me some time to check them
manually, and I have 2 functions to check.

Is there a utility or something that will do this for me?

Thanks!


There are a few third party utilities that will do this:

Free: http://www3.bc.sympatico.ca/starthere/findandreplace
Find and Replace: http://www.rickworld.com
Speed Ferret: http://www.moshannon.com
Total Access Analyzer: http://www.fmsinc.com

Some of these links are rather old and may not be current.

You could also use VBA to loop through the QueryDefs collection and search for
the function name in the SQL property:

Dim qd As DAO.Querydef
For Each qd IN CurrentDb.Querydefs
If InStr("MyFunction", qd.Sql) 0 Then
Debug.Print qd.Name
End If
End Sub

Untested air code!
--

John W. Vinson [MVP]
  #3  
Old May 7th, 2010, 01:09 AM posted to microsoft.public.access.queries
fredg
external usenet poster
 
Posts: 4,386
Default Finding a function call in queries

On Thu, 6 May 2010 15:57:01 -0700, cherman wrote:

Does anyone know of a way to find if a function is being called from a query?
Another words, I have a function that might be called from 1 or more queries
in my DB and I am looking for a quick way to see which queries it is called
from.

With over 200 queries in my DB, it will take me some time to check them
manually, and I have 2 functions to check.

Is there a utility or something that will do this for me?

Thanks!


Public Sub FindFunction()
Dim qdf As DAO.QueryDef
For Each qdf In CurrentDb.QueryDefs
If InStr(qdf.SQL, "FunctionName1") 0 Or InStr(qdf.SQL,
"FunctionName2") 0Then
Debug.Print qdf.Name & " " & qdf.SQL
End If
Next

End Sub
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 




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 01:00 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.