Email Report - Parameter Query Issue

D

doodle

windows xp
access 97

greetings all.

I have a custom form at startup with a report section. This section has
a combo box where the user selects the report from the list. There are
three command buttons, E-mail Report, Preview Report and Print Report.

E-mail Report is the problem. It works for all of the reports except
for one. This report references a parameter query, prompting the user
for a serial #.

I have other reports that reference parameter queries and they email
without issues.

The problem report actions:

1. User selects Teardown Report from the list.
2. User clicks 'E-mail Report' cmdButton
3. User is prompted for Serial #.
4. Error

It returns the following error:

Runtime error 2482
Spindle Database can't find the name 'Enter Machine Serial #' you
entered in the expression.

Troubleshoot:
1. The query runs fine on its own.
2. The report previews and prints fine.
3. The parameter query is setup identical to the ones that work.


Thanks in advance for your help.

doodle

Here is my email code:

Private Sub cmdEmail_Click()
Dim strMessage As String
Dim strSubject As String

'On Error Resume Next
strMessage = "If you cannot open the attached file, then you need to
install " _
& "the SnapShot viewer utility. It can also be downloaded from
Microsoft at: " _
& vbCrLf &
"http://support.microsoft.com/default.aspx?scid=kb;en-us;175274" _
& vbCrLf & vbCrLf & "Make a note of the folder that you save it
to.After the " _
& "download is complete, use Windows Explorer to open this folder,
and install the " _
& "viewer by double-clicking on the Snapvw.exe file."
strSubject = cmdReport



Select Case cmdReport

'Problem
Case "Teardown Report By Serial #"
DoCmd.SendObject acReport, "rptTeardownBySerialNum",
"Snapshot Format", , , , strSubject,
Case Else
MsgBox Prompt:="You must select a report to email from the
list.", Buttons:=vbOKOnly, _
Title:="Message From Adria"
End Select

[cmdReport].Value = "Pick report from list..."

End Sub
 
D

doodle

OK all. I figured out the problem, now I need a solution. The report I
am having trouble sending via email contains pictures. The issue is
that I don't store the pictures in the database, I store them on the
server and store the network path in the database.

So users are getting an error that the database cannot open the bitmap.


Here is the code on my report:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Error Resume Next
Me![ImageFrame_1].Picture = Me![ImagePath_1]
Me![ImageFrame_2].Picture = Me![ImagePath_2]
Me![ImageFrame_3].Picture = Me![ImagePath_3]
Me![ImageFrame_4].Picture = Me![ImagePath_4]
Me![ImageFrame_5].Picture = Me![ImagePath_5]
Me![ImageFrame_6].Picture = Me![ImagePath_6]
Me![ImageFrame_7].Picture = Me![ImagePath_7]
Me![ImageFrame_8].Picture = Me![ImagePath_8]
Me![ImageFrame_9].Picture = Me![ImagePath_9]
Me![ImageFrame_10].Picture = Me![ImagePath_10]
End Sub
 

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