If you go into immediate mode and type in something like the following
you'll se how to condtruct the looping to 'enumerate' you queries
? currentDb.QueryDefs.Count
30 [the go from 0 to this so you need to loop 0 to 29]
? currentDb.QueryDefs(29).Name
Query2 [this happened to be my last one
~sq_fProviders [this was number 13 and you will need to bypass these -
they're system queries rather than your own]
AssessmentList [this was number 14 - the first of my own defined queries]
? currentDb.QueryDefs(13).Fields.Count [gets the number of columns for query
number 13
31
? currentDb.QueryDefs(13).Fields(0).Name [gets the name of each column in
the query
Provider.aaa_Provider_id
Now! you're going to have a problem with columns which have been renamed
with AS xxxxx
If there aren't any you may be ok! you could store all the results in a
table
then look see which of the columns in the 2 linked tables are being used
(in which queries)
ALTERNATIVELY
you could use
? currentDb.QueryDefs(14).SQL
SELECT [Assessment].[aaa_Assessment_id], [Assessment].[ParticipantId],
Format([Assessment].[aDate],"d mmm yy") AS AssDate,
Format([Assessment].[TimeOfAsessment],"Short Time") AS AssTime,
[Provider].[prFirst_name] & " " & [Provider].[prLast_name] & " (" &
[Provider].[prNickName] & ")" AS AsessorFullName, [Participant].[IsChild]
FROM Provider INNER JOIN (Participant INNER JOIN Assessment ON
[Participant].[aaa_Participant_id]=[Assessment].[ParticipantId]) ON
[Provider].[aaa_Provider_id]=[Assessment].[AssessorId]
WHERE ((([Assessment].[ParticipantId])=[forms]![Participants2]![SrchId]))
ORDER BY [Assessment].[aDate];
then, in code get each column reference between SELECT and FROM
This way you'll see the 'AS's - and be able to do a select to pull us a
list.
HOWEVER - if the Front end Code generates sql using the tables concerned it
may be that you're using columns form the tables that aren't used in ANY of
your queries!
If you've got the idea of the above yopu're probably well on the way to
doing a coded search through your code to find any such occurences
AND THE BEST OF LUCK!!