Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send report problems

Status
Not open for further replies.

wbecke

Technical User
Aug 9, 2004
1
AT
Hi everyone,
I have problems by sending a complex report. The following code produces the programmed error message. After that I have to exit Access and kill it in the taskmanager to resume to normal work...

On Error GoTo Err_BerichtSendFirma_Click

Dim stDocName As String
Dim cc As String
Dim mldg, titel, antwort, Subject

If Forms![Eildienst Bestellantrag].[Email-Empfänger].Visible = True Then
cc = Forms![Eildienst Bestellantrag].[Email-Empfänger]
Else
cc = Null
End If

Subject = "Leiterplatten-Bestellung"
stDocName = "EildienstExtern"
DoCmd.SendObject acReport, stDocName, acFormatRTF, LiefMail, cc, , Subject

Exit_BerichtSendFirma_Click:
Exit Sub

Err_BerichtSendFirma_Click:
mldg = "Mögliche Fehler:" & Chr(13) & Chr(10) & _
"1) Es ist kein Aussteller ausgewählt" & Chr(13) & Chr(10) & _
"2) Dem Lieferant ist keine Email-Adresse zugeordnet." & Chr(13) & Chr(10) & _
"3) 'Musterbau' ist angeklickt und dem Fax-Empfänger ist keine Email-Adresse zugeordnet"


titel = "Fehler beim Senden"

antwort = MsgBox(mldg, vbOKOnly, titel)
Resume Exit_BerichtSendFirma_Click



Even if I take out the If ... Else...End If Loop, it won't work.

The Report contains a lot of data out of different tables. Can that be the problem? The same code works perfectly well for simple report...

To start the code I click on a button in the form "Eildienst Bestellantrag"...

Please help me to get rid of that strange error!

TIA Walt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top