D
Dudley
I would like to delete all records in my invoicing database where the last
invoiced amount is zero, and I found found the following code which looks as
if it can be adapted for this:
Function LastInvoiceAmount(Client As String) As Currency
On Error GoTo Err_LastInvoiceAmount
Dim LastIN As Long
LastIN = Nz(DMax("[Invoice Number]", "Invoices", _
"[Customer Code] ='" & Client & "'"), 0)
End_LastInvoiceAmount:
If LastIN = 0 Then
LastInvoiceAmount = 0
Else
LastInvoiceAmount = InvoicePriceIncVAT(LastIN)
End If
Exit Function
Err_LastInvoiceAmount:
MsgBox "Error " & Err.Number & ": " & _
Err.Descriptiong
Resume End_LastInvoiceAmount
End Function
Can anyone tell me how I can delete all records where LastIN = 0?
Thanks very much for any help.
Dudley
invoiced amount is zero, and I found found the following code which looks as
if it can be adapted for this:
Function LastInvoiceAmount(Client As String) As Currency
On Error GoTo Err_LastInvoiceAmount
Dim LastIN As Long
LastIN = Nz(DMax("[Invoice Number]", "Invoices", _
"[Customer Code] ='" & Client & "'"), 0)
End_LastInvoiceAmount:
If LastIN = 0 Then
LastInvoiceAmount = 0
Else
LastInvoiceAmount = InvoicePriceIncVAT(LastIN)
End If
Exit Function
Err_LastInvoiceAmount:
MsgBox "Error " & Err.Number & ": " & _
Err.Descriptiong
Resume End_LastInvoiceAmount
End Function
Can anyone tell me how I can delete all records where LastIN = 0?
Thanks very much for any help.
Dudley