L
Lee Taylor-Vaughan
This code is to send a fax: which it does, but it sends all records in the
recordset to all the people.
e.g. there are 7 people in the query that is access (recordset). It sends
all customers info to every fax number, what am i doing wrong
in the open event of the report i have me.filter = strHospWhere (i
have a feeling that it is has something to do with this.)
Please, any pointers.
Lee
Function SendFax()
Dim dbsMICU As DAO.Database
Dim rstDisposNeeded As DAO.Recordset
Set dbsMICU = CurrentDb()
Set rstDisposNeeded = dbsMICU.OpenRecordset("qryDispoManagerFax", _
dbOpenDynaset)
If MsgBox("Do you want to send Dispo Faxes to ED's?", _
vbYesNo + vbQuestion, "Fax Dispos") = 6 Then
With rstDisposNeeded
Do Until .EOF
strHospWhere = "[Hosptial] = ![Hospital]"
If Len(![Fax]) > 0 Then
DoCmd.SendObject acSendReport, "rptDispoFax", acFormatRTF _
, "[fax: " & ![Fax] & "]", , , , , False
Else
'do nothing
End If
.MoveNext
Loop
End With
End If
rstDisposNeeded.Close
End Function
recordset to all the people.
e.g. there are 7 people in the query that is access (recordset). It sends
all customers info to every fax number, what am i doing wrong
in the open event of the report i have me.filter = strHospWhere (i
have a feeling that it is has something to do with this.)
Please, any pointers.
Lee
Function SendFax()
Dim dbsMICU As DAO.Database
Dim rstDisposNeeded As DAO.Recordset
Set dbsMICU = CurrentDb()
Set rstDisposNeeded = dbsMICU.OpenRecordset("qryDispoManagerFax", _
dbOpenDynaset)
If MsgBox("Do you want to send Dispo Faxes to ED's?", _
vbYesNo + vbQuestion, "Fax Dispos") = 6 Then
With rstDisposNeeded
Do Until .EOF
strHospWhere = "[Hosptial] = ![Hospital]"
If Len(![Fax]) > 0 Then
DoCmd.SendObject acSendReport, "rptDispoFax", acFormatRTF _
, "[fax: " & ![Fax] & "]", , , , , False
Else
'do nothing
End If
.MoveNext
Loop
End With
End If
rstDisposNeeded.Close
End Function