G
Guest
Hi. I'm sure someone has seen this before. I'm stuck. I have a module that
I'm using to send some reports automatically using a looping code. This
technique seemed to work fine in my other databases but suddenly is not.
Here's what I have:
Set db = CurrentDb
Set rsTM = db.OpenRecordset("SELECT * FROM SalesTerritory")
If Not rsTM.EOF Then
Do While Not rsTM.EOF
Set rsCore = db.OpenRecordset("SELECT * " & _
"FROM [vwPerformanceTerritory] WHERE
[TerritoryID] = rsTM![TerritoryID]")
CoreLBDValue = Nz(rsCore![ShipDollarsLBD], 0)
CoreMTDValue = Nz(rsCore![ShipDollarsMTD], 0)
etc...
The error is happening on the line entitled Set rsCore=...
I guess I'm supposed to define parameters or something but I'm not sure how.
Any suggestion would be great. Thanks!
I'm using to send some reports automatically using a looping code. This
technique seemed to work fine in my other databases but suddenly is not.
Here's what I have:
Set db = CurrentDb
Set rsTM = db.OpenRecordset("SELECT * FROM SalesTerritory")
If Not rsTM.EOF Then
Do While Not rsTM.EOF
Set rsCore = db.OpenRecordset("SELECT * " & _
"FROM [vwPerformanceTerritory] WHERE
[TerritoryID] = rsTM![TerritoryID]")
CoreLBDValue = Nz(rsCore![ShipDollarsLBD], 0)
CoreMTDValue = Nz(rsCore![ShipDollarsMTD], 0)
etc...
The error is happening on the line entitled Set rsCore=...
I guess I'm supposed to define parameters or something but I'm not sure how.
Any suggestion would be great. Thanks!