A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

SendObject doesn't find fields in querry



 
 
Thread Tools Display Modes
  #1  
Old March 18th, 2010, 04:05 AM posted to microsoft.public.access
J.Bennett
external usenet poster
 
Posts: 45
Default SendObject doesn't find fields in querry

I have a form that has a button to run an "event Procedure" to preview a
report, and to email the report as a pdf attachment. The codes I use are as
follows:

Private Sub emailfullpricesheet_Click()

DoCmd.OpenReport "Full Price Sheet", acViewPreview, , , acWindowNormal
DoCmd.SendObject acSendReport, "Full Price Sheet", acFormatPDF, , , ,
[DLRName], _
"Thank You for your business.", True

End Sub

In this code, I have the field for the dealer name (shown above as
[DLRName]) where it would be placed in the subject line. However, when I run
this button with any field name included, I get an error message as follows:

Run-time error '2465'
Microsoft Office Access can't find the filed '|' referenced in our expression.

The field name is correct. I have even tried other field names from the
query. Additionally, this field name is on the report produced in the first
commad of the event procedure and the report is displayed correctly.

Can anyone help with what I am doing wrong that prevents fields from being
displayed? Otherwise, I can simply use an embedded Macro. However, I want
the ability to reference the specific dealer information.

Any help would be greatly appreciated.

Frustrated!!!!!
  #2  
Old March 18th, 2010, 12:23 PM posted to microsoft.public.access
Rick Brandt
external usenet poster
 
Posts: 4,354
Default SendObject doesn't find fields in querry

J.Bennett wrote:
I have a form that has a button to run an "event Procedure" to preview a
report, and to email the report as a pdf attachment. The codes I use are
as follows:

Private Sub emailfullpricesheet_Click()

DoCmd.OpenReport "Full Price Sheet", acViewPreview, , , acWindowNormal
DoCmd.SendObject acSendReport, "Full Price Sheet", acFormatPDF, , , ,
[DLRName], _
"Thank You for your business.", True

End Sub

In this code, I have the field for the dealer name (shown above as
[DLRName]) where it would be placed in the subject line. However, when I
[run
this button with any field name included, I get an error message as
follows:

Run-time error '2465'
Microsoft Office Access can't find the filed '|' referenced in our
expression.

The field name is correct. I have even tried other field names from the
query. Additionally, this field name is on the report produced in the
first commad of the event procedure and the report is displayed correctly.

Can anyone help with what I am doing wrong that prevents fields from being
displayed? Otherwise, I can simply use an embedded Macro. However, I
want the ability to reference the specific dealer information.


SendObject has no access to any of the fields in the report. Code within
the report's own events can access field data but SendObject is running
external to the report and has no "knowledge" of the data the report is
using.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.