• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

Access 97 glitches emailing report in snapshot format using the SendObject method.

Problem Statement:  Access 97 glitches on 12 lines of code in a report that is being emailed in snapshot format using the SendObject method.

Problem:
A report containing 64 image controls where the “picture” properties are set by code in the On Format event cannot be sent in Snapshot Format using the SendObject method in an Access 97 database.

Unexplained Behavior:
…The report can be printed or viewed without error.

…If a specific 12 (of the 64) lines of code (that are used to set the picture property for the image controls) are dimmed, then the report can be sent without error.  Only these specific 12 lines cause the error, however, they are virtually identical to all of the rest – just referencing a different control.

…If the database is converted to Access 2000 the entire report (all image controls) can be sent without error.  Note: I need to use Access 97 because it will eventually be converted to a runtime application using the Access 97 ODE and a third party installation program for Access 97.

Solutions Attempted:
Created new database and imported all objects except the form that contains the command button that is used to “Send” the report and the report itself.  Then rebuilt both the form and report in the new database.  The new database produced exactly the same results.

Error message: (upon clicking the “Send” command button)
Error No: 2465
Microsoft Access can’t find the field ‘Forms’ referred to in your expression.
You may have misspelled the field name, or the field may have been renamed or deleted.

**** Code from the form’s On Click event for the “Send” command button *************************

strOutputFormat = "Snapshot Format"    ‘Note:  This format is undocumented except by an example.
DoCmd.SendObject acSendReport, stDocName, strOutputFormat, strEmail, , , strSubject, strMsg, True


**** Code from the report’s On Format event for the Page Header *******************************

Dim frm As Form
       
If Not IsLoaded("frmPlay") = True Then
    GoTo PageHeader_Format_exit
End If
   
Set frm = Forms!frmPlay

Me.imgA1.Properties("Picture") = frm!cmdA1.Picture
Me.imgA2.Properties("Picture") = frm!cmdA2.Picture
Me.imgB1.Properties("Picture") = frm!cmdB1.Picture
Me.imgB2.Properties("Picture") = frm!cmdB2.Picture
Me.imgC1.Properties("Picture") = frm!cmdC1.Picture
Me.imgC2.Properties("Picture") = frm!cmdC2.Picture

*** Note:  Prior to using the “frm” object variable the code just referenced the specific form with the same results  (i.e. Me.imgC2.Properties("Picture") = Forms!frmPlay!cmdC2.Picture).
0
dbAl
Asked:
dbAl
  • 6
  • 5
1 Solution
 
shanesuebsahakarnCommented:
0
 
shanesuebsahakarnCommented:
Just an afterthought - does changing the syntax to:
Me!imgA1.Picture = frm!cmdA1.Picture
make a difference ?

What happens if you preview the report and then save it as a snapshot file ? Does OutputTo return the same error ?
0
 
dbAlAuthor Commented:
When using the term "Dimmed" in the question's text, I ment "Commented Out".
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
shanesuebsahakarnCommented:
dbAl, did the items I posted make a difference ? What was the result ?
0
 
dbAlAuthor Commented:
shanesuebsahakarn:

I checked into the link to Microsoft's Knowledgebase.  It wasn't relevent to my issue (i.e. none of the fields used in the record source of the report were reserved words).  In fact the report has no record source.  It does however have a subreport.  I checked its record source (only 4 fields) - none were reserved words.

Additionally, I attempted to save the report as a snapshot as you suggested.  Don't know why, but it didn't save anything.  The process I used was to select "Save As/Export..." and then select "To and External File", selected a folder for it to be saved into and selected "Snapshot" as the file type.  No error occurred but when I navigated to the place that it wase saved -- it isn't there??  Next, I tried to save it as a snapshot using the Access 2000 version of the same database, it worked fine.  In case it may be relevent, both Access 97 and Access 2000 are installed on my computer.

Thanks for you efforts.

Al
0
 
shanesuebsahakarnCommented:
That's weird - it would seem to indicate that the Snapshot export is broken in the A97 version. You could try uninstalling and re-installing Snapshot Viewer and see if that helps ?
0
 
dbAlAuthor Commented:
shanesuebsahakarn:

I removed and reinstalled Snapshot Viewer.  This did not correct the problem.  Next, I uninstalled and reinstalled Access 97 - still not working.  On a posibility that the problem may be related to a conflict having both Access 97 and 2000 on the same machine, I copied the database to another machine that only has Access 97 -- It worked??  I'm still not sure why it won't work on the machine it was developed on (in Access 97), but I can live with it working on another machine -- as long as it doesn't present a problem after a runtime database is created.

I'm new to Experts-Exchange and not sure of what to do to post a resolution on this issue.  Although your comments didn't actually solve the problem - they did at least serve to focus my attention to conditions outside the code module.  I'd like to give you the credit for resolving the issue.  What do I need to do?

Al
0
 
shanesuebsahakarnCommented:
Al, you could award a grade which reflects the fact that the answer didn't resolve your problem - a B or a C, for example rather than an A.

One thing I haven't mentioned though - how did you install both applications on the same machine ? I normally install A97 first and then install A2K (or A2K2) afterwards. I don't know if changing the install order could make a difference, although the machine that has both on already might need the full Office removal procedure for both versions before you can try it out. There are a couple of pages on the MSKB that give you the tools to do this (I think you need Eraser97 and Eraser2K to fully remove Office).
0
 
dbAlAuthor Commented:
shanesuebsahakarn:

Installation order was 97 then 2000.  To prevent possible conflicts 97 was installed in the directory: C:\Program Files\Microsoft Office97.  Access 2000 was later installed in a different directory: C:\Program Files\Microsoft Office2k.  I followed a MSKB for installing both on the same machine but still needed to use shortcuts with target lines pointing the the correct version of Access to make sure the Access 97 databases open correctly.

Al
0
 
shanesuebsahakarnCommented:
All I can suggest is to try removing both versions of Office and use Eraser. Then try the installation again - you could try reversing the process (A2K first then A97), but I don't know if this will make a difference. I've got a machine running two versions as well and I've not encountered the problem but I'm using Access 97 and 2002, rather than 2000.

Everything does point to the A97 installation not "liking" the A2K Snapshot, but I don't know how to fix this specific problem unfortunately. Sorry I couldn't help further.
0
 
dbAlAuthor Commented:
Thanks again,

Al
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now