?
Solved

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

Posted on 2003-03-22
11
Medium Priority
?
282 Views
Last Modified: 2007-12-19
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
Comment
Question by:dbAl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 8186216
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 8186220
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
 

Author Comment

by:dbAl
ID: 8186225
When using the term "Dimmed" in the question's text, I ment "Commented Out".
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 8186278
dbAl, did the items I posted make a difference ? What was the result ?
0
 

Author Comment

by:dbAl
ID: 8197072
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
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 8197540
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
 

Author Comment

by:dbAl
ID: 8199314
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
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 8199351
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
 

Author Comment

by:dbAl
ID: 8199431
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
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 1500 total points
ID: 8199813
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
 

Author Comment

by:dbAl
ID: 8202691
Thanks again,

Al
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question