Selective E-mails

G

Guest

Ok, this one might be tough.

I have queries looking for certain individuals who need training. A list of
these people is then created.

Next to each name is a command button. This command button builds a report
for the paperwork required. Using the Me.Dirty stuff, I used to be able to
print the reports individually, and life was good.

Now the boss wants these reports via e-mail, and things are turning sour.
I've already learned how to e-mail the report, but the report includes
everybody the query resulted in, so I could be sending five reports in one
e-mail.

How can e-mail only the report that belongs to the name next to the command
button?
 
T

Tony Toews [MVP]

coconut78 said:
Ok, this one might be tough.
Nope.

How can e-mail only the report that belongs to the name next to the command
button?

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
G

Guest

Well, I tried that, and I'm getting errors. The page gives me the following
code:

Me.Filter = "ShipmentsID=" & Forms![Select Load List]![LoadID]
Me.FilterOn = True

Just for clarification, could you identify which of these are Forms, Tables,
and Query results? Or is ShipmentsID a report? Also, I'm using Access 2003,
and I noticed this was written for '97. Does that matter?
 
T

Tony Toews [MVP]

coconut78 said:
Well, I tried that, and I'm getting errors. The page gives me the following
code:

Me.Filter = "ShipmentsID=" & Forms![Select Load List]![LoadID]
Me.FilterOn = True

Just for clarification, could you identify which of these are Forms, Tables,
and Query results?

The form is Select Load List. The combo box on the form is named
LoadID.
Or is ShipmentsID a report?

ShipmentsID is a field in the query on which the report is based.
Also, I'm using Access 2003,
and I noticed this was written for '97. Does that matter?

No difference.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
D

Douglas J. Steele

In that example, ShipmentsID is assumed to be a field in the underlying
recordsource of the form. You're trying to create a filter that will only
return those rows where ShipmentsID is the same value as what's in a control
named LoadID on a form named Select Load List.

The syntax is the same in all versions of Access.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


coconut78 said:
Well, I tried that, and I'm getting errors. The page gives me the
following
code:

Me.Filter = "ShipmentsID=" & Forms![Select Load List]![LoadID]
Me.FilterOn = True

Just for clarification, could you identify which of these are Forms,
Tables,
and Query results? Or is ShipmentsID a report? Also, I'm using Access
2003,
and I noticed this was written for '97. Does that matter?

Tony Toews said:
For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
G

Guest

I'm sorry guys, I'm just not getting it.

I'm using the code :
Me.Filter = "FullName=" & Forms![Downgrade60Day]![FullName]
Me.FilterOn = True

The field on the report is "FullName" which is the same as on the Form
(Downgrade60Day)

I'm getting "Syntax error (missing operator) in query expression
'(FullName=CARTER,JOHN B.)'.

Sorry to bother.
 
T

Tony Toews [MVP]

coconut78 said:
I'm sorry guys, I'm just not getting it.

I'm using the code :
Me.Filter = "FullName=" & Forms![Downgrade60Day]![FullName]
Me.FilterOn = True

The field on the report is "FullName" which is the same as on the Form
(Downgrade60Day)

I'm getting "Syntax error (missing operator) in query expression
'(FullName=CARTER,JOHN B.)'.

Ah, that's a text field thus you need quotes.
Me.Filter = "FullName='" & Forms![Downgrade60Day]![FullName] & "'"

Now you may want to use the primary key of the table involved as you
may have duplicate names, ie John Smith
Sorry to bother.

Not a bother. Please continue to ask questions.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
G

Guest

It works!! Thanks a million. I never would have figured this out on my own.

Tony Toews said:
coconut78 said:
I'm sorry guys, I'm just not getting it.

I'm using the code :
Me.Filter = "FullName=" & Forms![Downgrade60Day]![FullName]
Me.FilterOn = True

The field on the report is "FullName" which is the same as on the Form
(Downgrade60Day)

I'm getting "Syntax error (missing operator) in query expression
'(FullName=CARTER,JOHN B.)'.

Ah, that's a text field thus you need quotes.
Me.Filter = "FullName='" & Forms![Downgrade60Day]![FullName] & "'"

Now you may want to use the primary key of the table involved as you
may have duplicate names, ie John Smith
Sorry to bother.

Not a bother. Please continue to ask questions.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
T

Tony Toews [MVP]

coconut78 said:
It works!! Thanks a million. I never would have figured this out on my own.

Glad to hear it. And you're quite welcome.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top