J
jasoneplatt
I am trying to use a variable to repeat a macro. Depending on the
number of records in the affilliate table the macro will repeat once
for each. I can do the following:
Get the number of records in the affilliate table with SQL-
"SELECT Max(affilliate.aff_num) AS MaxOfaff_num FROM affilliate"
Repeat the macro for each record in the affilliate table-
Dim intRepeat as Integer
DoCmd.RunMacro "Copy Report", intRepeat, ""
What I don't know how to do is get the number of records from the SQL
query (or the temporary table it creates) to the intRepeat variable.
Am I going about this all wrong or am I just missing something. I have
searched far and wide for an answer and plenty of people are
interested in passing a variable to a query but I need to GET a
varible FROM a query.
Any help is much appreciated.
number of records in the affilliate table the macro will repeat once
for each. I can do the following:
Get the number of records in the affilliate table with SQL-
"SELECT Max(affilliate.aff_num) AS MaxOfaff_num FROM affilliate"
Repeat the macro for each record in the affilliate table-
Dim intRepeat as Integer
DoCmd.RunMacro "Copy Report", intRepeat, ""
What I don't know how to do is get the number of records from the SQL
query (or the temporary table it creates) to the intRepeat variable.
Am I going about this all wrong or am I just missing something. I have
searched far and wide for an answer and plenty of people are
interested in passing a variable to a query but I need to GET a
varible FROM a query.
Any help is much appreciated.