G
Guest
I have this annoying bug that is driving me up the wall. This code used to
work but has suddenly stopped. When a user closes the report, if they answer
Yes to the prompt, I want a field called Invoiced to be set to true.
If anyone can help, I'd really appreciate it.
The code I am using is:
Private Sub Report_Close()
Dim strMess As String
Dim rs As Recordset
Dim rsInvNo As Recordset
If Not blnReprint Then
strMess = "Would you like to mark the displayed dockets as
Invoiced?" & vbLf
strMess = strMess & "If you select Yes, you will not be able to
invoice these dockets again."
If MsgBox(strMess, vbYesNo + vbQuestion, gstrAppName) = vbYes Then
If glngCustomerID > -1 Then
Set rs = DBEngine(0)(0).OpenRecordset("SELECT * from
qryInvoice WHERE DocketDate between #" & getStartDate() & "# and #" &
getEndDate() & "# AND CustomerID = " & getCustID())
Else
Set rs = DBEngine(0)(0).OpenRecordset("SELECT * from
qryInvoice WHERE DocketDate between #" & getStartDate() & "# and #" &
getEndDate() & "# AND CustomerID <> 6")
End If
While Not rs.EOF
rs.Edit
rs!Invoiced = True
rs.Update
rs.MoveNext
Wend
End If
End If
End Sub
Regards
Sandy
work but has suddenly stopped. When a user closes the report, if they answer
Yes to the prompt, I want a field called Invoiced to be set to true.
If anyone can help, I'd really appreciate it.
The code I am using is:
Private Sub Report_Close()
Dim strMess As String
Dim rs As Recordset
Dim rsInvNo As Recordset
If Not blnReprint Then
strMess = "Would you like to mark the displayed dockets as
Invoiced?" & vbLf
strMess = strMess & "If you select Yes, you will not be able to
invoice these dockets again."
If MsgBox(strMess, vbYesNo + vbQuestion, gstrAppName) = vbYes Then
If glngCustomerID > -1 Then
Set rs = DBEngine(0)(0).OpenRecordset("SELECT * from
qryInvoice WHERE DocketDate between #" & getStartDate() & "# and #" &
getEndDate() & "# AND CustomerID = " & getCustID())
Else
Set rs = DBEngine(0)(0).OpenRecordset("SELECT * from
qryInvoice WHERE DocketDate between #" & getStartDate() & "# and #" &
getEndDate() & "# AND CustomerID <> 6")
End If
While Not rs.EOF
rs.Edit
rs!Invoiced = True
rs.Update
rs.MoveNext
Wend
End If
End If
End Sub
Regards
Sandy