Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create report for each record in a datasheet subform 1

Status
Not open for further replies.

TrekBiker

Technical User
Nov 26, 2010
330
GB
My Pick List form has a combo to select a delivery date.

This is used to show all orders due for delivery on this date in a the top datasheet subform. Stepping down through this datasheet shows all of the current order's items in a second Datasheet subform, sfmPickListBarcodes.

Pick_List_Form_wogxtl.jpg


I now want to create labels for items in the currently selected order, extracting their Product Names, Quantities and Barcodes that contain 'SI' and the OrderItemID.

So for OrderID 151206 I want the report to generate 3 labels showing Maldon Gold, SI233194, and 2 showing Jake, SI233195.

As a test I tried using this for the Command Button

Code:
    With Forms!frmPickList.sfmPickListBarcodes.Form.RecordsetClone
        .MoveFirst
        Do Until .EOF
        Debug.Print sfmPickListBarcodes.Form.ProductName
        Debug.Print sfmPickListBarcodes.Form.Quantity
        .MoveNext
        Loop
        End With

But this just repeated the name and quantity for the first row, not moving to the second.
 
How about:

Code:
With Forms!frmPickList.sfmPickListBarcodes.Form.RecordsetClone
    .MoveFirst
    Do Until .EOF
        Debug.Print !ProductName.Value
        Debug.Print !Quantity.Value
        .MoveNext
    Loop
End With

If ProductName and Quantity are the fields' names of your RecordsetClone

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Thank you so much, one small change that fixes it!




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top