Lynn,
A macro Condition is an expression which evaluates to either True or
False, on the basis of which it determines whether or not a macro Action
is activated. For the record, the two expressions you tried can not
evaluate to true or false. In the case of the Reports reference, Access
would need to know "which record" in the report, and even then, only if
the report is open, which in your case it isn't. And the Tables
reference is invalid syntax and doesn't make sense.
If you have a form, probably in continuous view, listing your customers,
or alternatively a combobox where you can select one of your customers
from the drop down list, it is a relatively simple thing to use a
SendObject macro to send a report to the selected customer containing
only their data. All you need to do is base the report on a query which
makes reference in its criteria to the value of the Customer Number of
the active record on the form (or the selected customer in the combobox)
using syntax such as [Forms]![NameOfForm]![CustomerNumber]. You could
do this for the relevant customers one by one.
If, on the other hand, you are hoping to do a one-click process to send
a personalised email to all customers, I'm afraid this is not so simple.
If you want to use a macro, it is possible. You would have to make
the SendObject macro as before, to send to the customer of the current
record on a continuous form, and then add a GoToRecord,Next action after
the SendObject. You would then make another macro, using the RunMacro
action, to run the first macro, and set its Repeat Count argument equal
to the number of customers.
Otherwise, you would need to look at a VBA procedure, which would in
this case be smoother and simpler.
--
Steve Schapel, Microsoft Access MVP
Steve, The macro's argument includes the following: Object Type -
I've selected "Report" Object Name - My report name is "DPRT BOL
Report" Output format - I've selected "Rich Text Format" To - I've
been testing with my own email address CC - none BCC - none Subject -
DPRT BOL's Message Text - none Edit Message - I've selected "No"
Template File - none
As for the Condition, I was hoping that I could automate the process
for sending the same"report" to customers, but specify for each
report only that information that relates with that customer. In
this case, I'm creating multiple Bills of Lading for multiple
customers in a day. The Customer Number field would be the Condition
for selecting which records would appear on the report and be sent to
the customer's email address appearing in the "To" field.
Using expression builder, I picked the Customer Number from the
Report....that gave me an error message (telling me that I must have
misspelled the name or it does not exist), so I tried by selecting
the Customer Number from the underlying Table....again, an error
message (this one saying that it can't the name in the entered
expression). Here are just two Conditions I've tried, and I've tried
several others.... [Reports]![DPRT BOL Report]![Customer Number] =
"283107"
![DPRT BOL's]![Customer Number] = "283107"
As I mentioned, I didn't have any trouble using the SendObject
function for sending the entire report....I just haven't been able to
figure out how to distinguish what records to send to which
customers. Maybe the Condition feature doesn't apply to this Macro
option.
Appreciate any assistance you might be able to offer. Thanks.
Lynn