> hi folks.
>
[quoted text clipped - 26 lines]
> thx
> tina :)
thanks for taking the time to respond, Klatuu. that solution would work if
the action queries were all hard-coded into the procedure, because i could
also hard-code the table objects to be deleted at the appropriate point in
the process.
the procedure i wrote is a generic handling procedure that loops through a
list of action queries, as
Do
strName = Rst("QueryName")
CurrentDb.Execute strName, dbFailOnError
Rst.MoveNext
Loop Until Rst.EOF
i have no way of knowing which, if any, of the action queries in a given
list will be make-table queries - so a DeleteObject command is not always
appropriate in a given cycle of the loop.
the user defines the sequential list of specific action queries from a
"master" list of action queries. i could require the user to manually
designate which of the chosen queries is a make-table query; in fact, that
was my original solution (before i wrote the DoCmd.OpenQuery) solution. but
it's a clunky solution, prone to user error, and i prefer to handle the
issue entirely programmatically.
another possible avenue: the "master" list of queries is created by
appending the names of all action queries into a table using the following
code, as
For Each varQry In CurrentDb.QueryDefs
If Left(varQry.Name, 1) = "~" Or _
Left(varQry.Name, 1) = "r" Then
' skip this query because it's a combobox sql
' querydef or an "r" report recordsource
Else
CurrentDb.Execute "INSERT INTO tblQueries " _
& "( QueryName ) SELECT '" _
& varQry.Name & "'", dbFailOnError
End If
Next
is there any way to examine a query object programmatically and 1) determine
whether or not it is a make-table query, and 2) if it is, determine what
name will be assigned to the "new" table? if so, i could capture that data
and append it into the master list, also.
as before, i appreciate all comments, suggestions, critiques that anyone
cares to offer.
thx,
tina :)
> Use the DeleteObject method to delete the tables before you execute the make
> table query:
[quoted text clipped - 32 lines]
> > thx
> > tina :)