J
Jacinda
Q: I need to print a batch of "shopcopy" forms, and I need it to group them
by order number... some orders have 1 shopcopy and others may have 5, etc.
When I use the code below, it opens all of the shopcopy forms instead of
walking through the recordset order number by order number....
what am I missing?
my filter on my form is strWhereShop.
Function Shopcopy()
Dim dbsallinonenew As DAO.Database
Dim rstShopcopy As DAO.Recordset
Set dbsallinonenew = currentdb()
Set rstShopcopy = dbsallinonenew.OpenRecordset("Qshopopen", _
dbOpenDynaset)
If MsgBox("Do you want to Print Production Shopcopys?", 4) = 6 Then
With rstShopcopy
Do Until .EOF
'Create the report Filter
'used by the Report_Open event.
strWhereShop = "[ID_ORD]= " & ![ID_ORD]
DoCmd.OpenReport "rshoptoday", acViewPreview
.MoveNext
Loop
End With
End If
rstShopcopy.close
End Function
by order number... some orders have 1 shopcopy and others may have 5, etc.
When I use the code below, it opens all of the shopcopy forms instead of
walking through the recordset order number by order number....
what am I missing?
my filter on my form is strWhereShop.
Function Shopcopy()
Dim dbsallinonenew As DAO.Database
Dim rstShopcopy As DAO.Recordset
Set dbsallinonenew = currentdb()
Set rstShopcopy = dbsallinonenew.OpenRecordset("Qshopopen", _
dbOpenDynaset)
If MsgBox("Do you want to Print Production Shopcopys?", 4) = 6 Then
With rstShopcopy
Do Until .EOF
'Create the report Filter
'used by the Report_Open event.
strWhereShop = "[ID_ORD]= " & ![ID_ORD]
DoCmd.OpenReport "rshoptoday", acViewPreview
.MoveNext
Loop
End With
End If
rstShopcopy.close
End Function