S
Shane Devenshire
Hi Folks,
I posted this the another newsgroup and got no responses, so I'm rephrasing
it here and trying again. I'm trying to automate the process of printing a
report for each unique customer.
If can't get the sql where clause I need, at least that's what I think is
wrong. Here is the code line that fails: The report opens but is empty,
there is no error message caused by this line.
DoCmd.OpenReport "CustomerReport", acViewPreview, , CustomerID =
myCustomerID
CustomerReport is the name of the report to open
CustomerID is the field in the query for which I want to set the criteria
myCustomerID is a variable where I store each unique customer ID as I cycle
through the open recordset (which is not the same one as where the
CustomerID is coming from in the query.
Do I need to open both record set to get this to work or is the Where
condition written incorrectly. I have tested and the myCustomerID variable
contains the unique ID. After the above line is run CustomerID shows as
Empty. I have tried qualifying it, for example tblOrders.CustomerID but
this generates an object required error message.
TIA,
SD
I posted this the another newsgroup and got no responses, so I'm rephrasing
it here and trying again. I'm trying to automate the process of printing a
report for each unique customer.
If can't get the sql where clause I need, at least that's what I think is
wrong. Here is the code line that fails: The report opens but is empty,
there is no error message caused by this line.
DoCmd.OpenReport "CustomerReport", acViewPreview, , CustomerID =
myCustomerID
CustomerReport is the name of the report to open
CustomerID is the field in the query for which I want to set the criteria
myCustomerID is a variable where I store each unique customer ID as I cycle
through the open recordset (which is not the same one as where the
CustomerID is coming from in the query.
Do I need to open both record set to get this to work or is the Where
condition written incorrectly. I have tested and the myCustomerID variable
contains the unique ID. After the above line is run CustomerID shows as
Empty. I have tried qualifying it, for example tblOrders.CustomerID but
this generates an object required error message.
TIA,
SD