J
jimpaige via AccessMonster.com
I think I need to write code for a LOOP I want to replace having to run a
macro and manually input different variables 30- 40 times.
Any help or direction would save me hours each month since I have 30- 40
salespeople, and the number varies, and I do similar things for other reports.
I now have to run the query 30- 40 times (once for each sales person)
I have a query that uses two tables, linked by the field [REP]
Table name: INQUIRIES (each record is one inquiry - a sales prospect)
Table name: REPMASTER (one record for each salesman “repâ€)
Query name: BYREPS- contains all fields from table INQUIRIES and 3 fields
from
table REPMASTER
Report Name: NEW INQUIRIES
Email Address: field [repEMAIL] in table REPMASTER
I run a macro REPORTS BY REP that runs the select query BYREP, I input one
variable for [REP] (before I run the macro, I edit the Send Object line to
put in the correct email address that corresponds to the [REP] for whom I am
running the query/report (email address is a field in table REPMASTER..
Based on the query BYREPS, macro REPORTS BY REP then:
• prints a report NEW INQUIRIES of all records in the query
• prints a report EACH NEW INQUIRY- 1 page for each record in query BYREPS
• email the report NEW INQUIRIES and report EACH NEW INQUIRY as snapshot
files to an email address in [repEMAIL] field in the table REPMASTER (I have
to input each email address)
If I can get this done automatically in a Loop or ?, then I can move to
Mail Merge to send a personalized letter to each inquiry (each record in
query BY REP)
macro and manually input different variables 30- 40 times.
Any help or direction would save me hours each month since I have 30- 40
salespeople, and the number varies, and I do similar things for other reports.
I now have to run the query 30- 40 times (once for each sales person)
I have a query that uses two tables, linked by the field [REP]
Table name: INQUIRIES (each record is one inquiry - a sales prospect)
Table name: REPMASTER (one record for each salesman “repâ€)
Query name: BYREPS- contains all fields from table INQUIRIES and 3 fields
from
table REPMASTER
Report Name: NEW INQUIRIES
Email Address: field [repEMAIL] in table REPMASTER
I run a macro REPORTS BY REP that runs the select query BYREP, I input one
variable for [REP] (before I run the macro, I edit the Send Object line to
put in the correct email address that corresponds to the [REP] for whom I am
running the query/report (email address is a field in table REPMASTER..
Based on the query BYREPS, macro REPORTS BY REP then:
• prints a report NEW INQUIRIES of all records in the query
• prints a report EACH NEW INQUIRY- 1 page for each record in query BYREPS
• email the report NEW INQUIRIES and report EACH NEW INQUIRY as snapshot
files to an email address in [repEMAIL] field in the table REPMASTER (I have
to input each email address)
If I can get this done automatically in a Loop or ?, then I can move to
Mail Merge to send a personalized letter to each inquiry (each record in
query BY REP)