Hi guy's yes i realized i had a typo then corrected the tbEdit, to tblEdit
This opens up the report and displays the same record on 2nd click then it moves to next then same again, it will open that same name (postcode) twice
Full code pasted
Will try debug.print as per WGM suggestion
do you need me to send record source properties of the report ?
Code:
Dim rs As DAO.RecordsetDim strDelTo As String, strPC as String
Dim myDate As Date
Dim intQty As Integer
If Me.cboPrint = "Print One" Then
myDate = Me.cboShipmentDateIndex1
Set rs = CurrentDb.OpenRecordset("Select * from tblEdit WHERE ShipmentDate = #" & myDate & "# Order By DelTo;")
If Not (rs.BOF And rs.EOF) Then
rs.MoveFirst
Do Until rs.EOF = True
strPC = rs.Fields("PostCode")
Me.txtPC = strPC
strDelTo = rs.Fields("DelTo")
Me.cboDeliveryPlanning = strDelTo
intQty = DCount("DelTo", "tblEdit", "[PostCode] = '" & strPC & "' And [ShipmentDate] = #" & myDate & "#")
If MsgBox("Print: " & strDelTo & " - " & strPC & " " & intQty & " Items", vbQuestion + vbYesNo, "PRINT NOW") = vbNo Then
Exit Sub
Else
DoCmd.OpenReport "rptShipmentInNameOne", acViewPreview 'Changing acViewNormal Once Working
End If
rs.MoveNext
Loop
End If
End If