Hi, there,
I have a form with 2 email buttons both with docmd.sendobject code.
The 1st one send a report which is working properly. The 2nd one send
a query in xls format which is always get an error message say" ....
can't save the output data to the file you selected." I am very
confused. it used to work properly. And now, sometimes it works, most
time it doesn't work.
I am using ACC2000, outlook express and Win XP. below are the 2 email
buttons' code:
'------------------------------------
Private Sub cmdEmail_Click()
Dim strToWhom As String
Dim strMsgBody As String
Dim intSeeOutlook As Integer
intSeeOutlook = MsgBox("Preview e-mail message?", _
vbYesNo, "RFQ " & Me.Caption)
If intSeeOutlook = vbNo Then
strToWhom = InputBox("Enter recipient's e-mail address.", _
"EMAIL Address")
intSeeOutlook = False
End If
DoCmd.SendObject acSendReport, "RFQ", "snapshot format", _
strToWhom, , , "RFQ " & Me.Caption, _
"Here is our RFQ", intSeeOutlook
End Sub
'---------------------------------------
Private Sub email2_Click()
On Error GoTo Err_email_Click
DoCmd.SendObject acSendQuery, "Email_RFQ_table", acFormatXLS, _
"ho*@meus.mea.com", , , "QDI " & Me.Caption, _
"Here is our QDI Data", , False
Exit_email_Click:
Exit Sub
Err_email_Click:
MsgBox Err.Description
Resume Exit_email_Click
End Sub
'-------------------------------
the "Email_RFQ_table" query is :
SELECT Bid_RFQ.*
FROM Bid_RFQ
WHERE (((Bid_RFQ.ID)=[forms]![rfq]![rfqid]));
also, bid_rfq is a query. So the "Email_RFQ_table" query is based on
another query. The 2 buttons are on the form called "RFQ".
Thanks alot. pls help me..