I have code that needs to repeat the same task, so I thought I would try a GoSub/Return code, however when I am looping thru a recordset that calls the gosub it seems to get no Return found when it gets to the last record in the recordset.
what am I missing?
Select Case MsgBox("Sorry unable to process request until Unpublished Invoice(s) have been processed/printed." _
& vbCrLf & "" _
& vbCrLf & "Do you wish to print UnPublished Invoices?" _
, vbOK Or vbCritical Or vbDefaultButton1, "Invoice Needs to be Printed")
gInvID = rs.Fields("IDinvoice")
Do Until rs.EOF
DoCmd.OpenReport "rptAPCodingSlip", acViewNormal, "IDInvoice = " & Chr(39) & gInvID & Chr(39) & ""
DoCmd.OpenReport "rptInvoiceActivity_Slip", acViewNormal, "ContractNo = " & Chr(34) & gContractID & Chr(34) & ""
DoCmd.RunSQL "Update tblinvoice Set RecordLock = -1 where IDInvoice = " & gInvID & ""