Email a report from a form for a single record

  • Thread starter Thread starter AL Rios
  • Start date Start date
A

AL Rios

I have been working this issue for two week and still can't get it.

When I open a form and want to email a report for that particular record,
The fiirst time it sends the correct record with the correct report...but
when I select next for the next record and I cliclk on my command button to
send the report for the next record it senda the previous record I sent.

Just a note I can print a individual record based on my report usiing me.ID
but can't send a email for that same record...

I'm new this but it is difficult ..can someone help...Urgent

Thank you...I learned all from this site and Thanks

AL
 
AL,

I suppose you are using a SendObject action. The SendObject does not have a
Where Condition argument, in the same way that an OpenReport does.

Therefore, I think you probably need to set the Record Source property of
your report to be a Query. And the query has in its Criteria for the ID
field, a reference to the current record on the form, using syntax such as
this:
[Forms]![NameOfYourForm]![ID]
 
Yes I do have that in my query but still no joy when I select next for the
follow on record..I get the same report from the previous...mya it be a set
focus or soimething..

When I cloe the form and opn I get the correct record but again when I move
the next record I still get the previous report.....

I am using a Macro tp send the email...

Thanls

AL
 
Al,

Can you please post a copy of the SQL view of the query that the report is
based on? And also give us the exact details of the macro? Thanks.
 
SQL
SELECT [IDE ].ID, [IDE ].Project, [IDE ].Number, [IDE ].Meeting, [IDE
].[ISSUE / ACTION ITEM], [IDE
].[POC(1)], [IDE ].[POC(2)], [IDE ].[DATE OPENED], [IDE ].[DUE DATE], [IDE
].[TARGET CLOSE DATE],
[IDE ].[ISSUE ACTION STATUS], [IDE ].[ISSUE STATUS (Current +
Historical)], [IDE ].URL, [IDE
].Lupdate
FROM [IDE ]
WHERE ((([IDE ].ID)=[forms]![Open]![ID]) AND (([IDE ].[ISSUE ACTION
STATUS])="O"))

Query Parameters
Name Type
[forms]![Open]![ID] Text



My Macro is as follows

Report Name = IDE OPEN
view = Print Preview
File name = Single Report
Where Condtion = [ID]
Windows Mode = Normal


Note: I would like to send the file without opening the the report and I
tried but cannot..I did select all the coice in view but when I select
another send the report of the last send is still viewable in Access..

Thanks for the Help
 
AL,

Well, the main problem I see here is with the 'Where Condition' argument in
the macro. This should be left blank in this example... you already have
the report restricted to the one record via the query criteria. In any
case, this is not the correct syntax for a Where Condition.

But this is relating to (presumably) an OpenReport action. Whereas I
thought you would be using a SendObject action. Do you hve that? If so,
you didn't show it. You do not need to use an OpenReport action of you are
wanting to send it by email.

There is probably no need to define a Parameter in the query like that. But
if you do, you should get the Type correct... I think it should be Number
not Text?

--
Steve Schapel, Microsoft Access MVP


AL Rios said:
SQL
SELECT [IDE ].ID, [IDE ].Project, [IDE ].Number, [IDE ].Meeting, [IDE
].[ISSUE / ACTION ITEM], [IDE
].[POC(1)], [IDE ].[POC(2)], [IDE ].[DATE OPENED], [IDE ].[DUE DATE], [IDE
].[TARGET CLOSE DATE],
[IDE ].[ISSUE ACTION STATUS], [IDE ].[ISSUE STATUS (Current +
Historical)], [IDE ].URL, [IDE
].Lupdate
FROM [IDE ]
WHERE ((([IDE ].ID)=[forms]![Open]![ID]) AND (([IDE ].[ISSUE ACTION
STATUS])="O"))

Query Parameters
Name Type
[forms]![Open]![ID] Text



My Macro is as follows

Report Name = IDE OPEN
view = Print Preview
File name = Single Report
Where Condtion = [ID]
Windows Mode = Normal


Note: I would like to send the file without opening the the report and I
tried but cannot..I did select all the coice in view but when I select
another send the report of the last send is still viewable in Access..

Thanks for the Help


Steve Schapel said:
Al,

Can you please post a copy of the SQL view of the query that the report
is
based on? And also give us the exact details of the macro? Thanks.

--
Steve Schapel, Microsoft Access MVP





.
 
Steve my sendobject is below

Sendobject

Object type =Report
Object name = IDE Open
Output Format = PDF

Thanks for the help

Al


Edit message = Yes

Steve Schapel said:
AL,

Well, the main problem I see here is with the 'Where Condition' argument in
the macro. This should be left blank in this example... you already have
the report restricted to the one record via the query criteria. In any
case, this is not the correct syntax for a Where Condition.

But this is relating to (presumably) an OpenReport action. Whereas I
thought you would be using a SendObject action. Do you hve that? If so,
you didn't show it. You do not need to use an OpenReport action of you are
wanting to send it by email.

There is probably no need to define a Parameter in the query like that. But
if you do, you should get the Type correct... I think it should be Number
not Text?

--
Steve Schapel, Microsoft Access MVP


AL Rios said:
SQL
SELECT [IDE ].ID, [IDE ].Project, [IDE ].Number, [IDE ].Meeting, [IDE
].[ISSUE / ACTION ITEM], [IDE
].[POC(1)], [IDE ].[POC(2)], [IDE ].[DATE OPENED], [IDE ].[DUE DATE], [IDE
].[TARGET CLOSE DATE],
[IDE ].[ISSUE ACTION STATUS], [IDE ].[ISSUE STATUS (Current +
Historical)], [IDE ].URL, [IDE
].Lupdate
FROM [IDE ]
WHERE ((([IDE ].ID)=[forms]![Open]![ID]) AND (([IDE ].[ISSUE ACTION
STATUS])="O"))

Query Parameters
Name Type
[forms]![Open]![ID] Text



My Macro is as follows

Report Name = IDE OPEN
view = Print Preview
File name = Single Report
Where Condtion = [ID]
Windows Mode = Normal


Note: I would like to send the file without opening the the report and I
tried but cannot..I did select all the coice in view but when I select
another send the report of the last send is still viewable in Access..

Thanks for the Help


Steve Schapel said:
Al,

Can you please post a copy of the SQL view of the query that the report
is
based on? And also give us the exact details of the macro? Thanks.

--
Steve Schapel, Microsoft Access MVP


Yes I do have that in my query but still no joy when I select next for
the
follow on record..I get the same report from the previous...mya it be a
set
focus or soimething..

When I cloe the form and opn I get the correct record but again when I
move
the next record I still get the previous report.....

I am using a Macro tp send the email...

Thanls



.
.
 
AL Rios said:
I have been working this issue for two week and still can't get it.

When I open a form and want to email a report for that particular record,
The fiirst time it sends the correct record with the correct report...but
when I select next for the next record and I cliclk on my command button
to
send the report for the next record it senda the previous record I sent.

Just a note I can print a individual record based on my report usiing
me.ID
but can't send a email for that same record...

I'm new this but it is difficult ..can someone help...Urgent

Thank you...I learned all from this site and Thanks

AL
 
Back
Top