Upgraded to 2007

J

Jacinda

Why doesn't this work anymore?

Function FaxInvoices()
Dim dbsallinonenew As DAO.Database
Dim rstCustomers As DAO.Recordset

Set dbsallinonenew = currentdb()
Set rstCustomers = dbsallinonenew.OpenRecordset("Qackopen ", _
dbOpenDynaset)

If MsgBox("Do you want to fax Acknowledgments?" & Chr(13) & _
"to all customers using Microsoft Fax?", 4) = 6 Then
With rstCustomers
Do Until .EOF
'Create the report Filter
'used by the Report_Open event.
strWhereack = "[ID_cust_soldto]= '" & ![ID_CUST_SOLDTO] & "'"

DoCmd.SendObject acReport, "racktoday", acFormatSNP, _
"[FAX:" & ![PHONE_FAX] & "]", , , , , , False
.MoveNext
Loop
End With
End If


rstCustomers.close

End Function

I checked my refrences, that does not seem to be the problem...
 
P

Piet Linden

Why doesn't this work anymore?

Function FaxInvoices()
    Dim dbsallinonenew As DAO.Database
    Dim rstCustomers As DAO.Recordset

    Set dbsallinonenew = currentdb()
    Set rstCustomers = dbsallinonenew.OpenRecordset("Qackopen ", _
        dbOpenDynaset)

    If MsgBox("Do you want to fax Acknowledgments?" & Chr(13) & _
        "to all customers using Microsoft Fax?", 4) = 6 Then
        With rstCustomers
            Do Until .EOF
                'Create the report Filter
                'used by the Report_Open event.
                strWhereack = "[ID_cust_soldto]= '" &![ID_CUST_SOLDTO] & "'"

                DoCmd.SendObject acReport, "racktoday", acFormatSNP, _
                    "[FAX:" & ![PHONE_FAX] & "]", , ,, , , False
                .MoveNext
            Loop
        End With
    End If

    rstCustomers.close

End Function

I checked my refrences, that does not seem to be the problem...

and when you compile/run it, what line does it crash out on?
 
J

Jacinda

It doesn't crash...it is supposed to give me one fax for each customer
group... instead it runs all of my reports under the first customer code...
--
-Jacinda


Piet Linden said:
Why doesn't this work anymore?

Function FaxInvoices()
Dim dbsallinonenew As DAO.Database
Dim rstCustomers As DAO.Recordset

Set dbsallinonenew = currentdb()
Set rstCustomers = dbsallinonenew.OpenRecordset("Qackopen ", _
dbOpenDynaset)

If MsgBox("Do you want to fax Acknowledgments?" & Chr(13) & _
"to all customers using Microsoft Fax?", 4) = 6 Then
With rstCustomers
Do Until .EOF
'Create the report Filter
'used by the Report_Open event.
strWhereack = "[ID_cust_soldto]= '" & ![ID_CUST_SOLDTO] & "'"

DoCmd.SendObject acReport, "racktoday", acFormatSNP, _
"[FAX:" & ![PHONE_FAX] & "]", , , , , , False
.MoveNext
Loop
End With
End If

rstCustomers.close

End Function

I checked my refrences, that does not seem to be the problem...

and when you compile/run it, what line does it crash out on?
 
A

Amicron

It's not an ANSWER, but try this for a possible SOLUTION (workaround):

Make a form with an unbound textbox called MyFaxNumber. Set the value
of that textbox equal to the fax number in your loop. So now you have
a form field called:

Forms!MyForm!MyFaxNumber

Now make a query that runs based on that form field as a parameter for
the fax number field, and base your report off of that query. Instead
of sending the fax number to the SendObject command, the report will
just get the value from the form.

It might not work, BUT I've seen this work in some instances where
sending a criteria to an OpenForm or OpenReport returned weird
results.

Let me know if it helps.

Richard Rost
http://www.AccessLearningZone.com?key=usenet
 

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