J
Jacinda
I have asked a similar question before, but my previous inqury was dealing
with fax only... Here is what I'm trying to do:
We would like to electronically send acknowledgements for our orders, either
by e-mail or by fax depending on the customer information (If e-mail is null
then fax) Okay, so right now I have a button that will do that on an
individual basis depending upon which client I pull up.
What I would like to do is a batch of acknowledgements...I'm willing to just
work with e-mail for right now and print the one's with a fax but I'm hitting
an error.-
Here is my code:
Private Sub Report_Open(Cancel As Integer)
On Error GoTo ProcError
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set re = db.OpenRecordset("QAcknowledgement", dbOpenSnapshot)
With rs
Do Until (.EOF Or .BOF) = True
DoCmd.OpenReport "racknowledgment2", acViewNormal, _
"custno = " & rs("custno")
rs.MoveNext
Loop
End With
ExitProc:
'cleanup
On Error Resume Next
rs.Close: Set rs = Nothing
db.Close: Set db = Nothing
Exit Sub
ProcError
MsgBox "Error" & Err.Number & ": " & Err.Description, _
vbCritical, "Error in Test subroutine..."
Resume ExitProc
End Sub
The error I get is "compile error: sub or function not defined"
Jacinda
with fax only... Here is what I'm trying to do:
We would like to electronically send acknowledgements for our orders, either
by e-mail or by fax depending on the customer information (If e-mail is null
then fax) Okay, so right now I have a button that will do that on an
individual basis depending upon which client I pull up.
What I would like to do is a batch of acknowledgements...I'm willing to just
work with e-mail for right now and print the one's with a fax but I'm hitting
an error.-
Here is my code:
Private Sub Report_Open(Cancel As Integer)
On Error GoTo ProcError
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set re = db.OpenRecordset("QAcknowledgement", dbOpenSnapshot)
With rs
Do Until (.EOF Or .BOF) = True
DoCmd.OpenReport "racknowledgment2", acViewNormal, _
"custno = " & rs("custno")
rs.MoveNext
Loop
End With
ExitProc:
'cleanup
On Error Resume Next
rs.Close: Set rs = Nothing
db.Close: Set db = Nothing
Exit Sub
ProcError
MsgBox "Error" & Err.Number & ": " & Err.Description, _
vbCritical, "Error in Test subroutine..."
Resume ExitProc
End Sub
The error I get is "compile error: sub or function not defined"
Jacinda