Hi,
Whats wrong with my code?
I want to check if a record exists that has the same coName,InvType,InvDate & Biweekly value. If it does then I'll go ahead and delete it, if it doesn't then it doesn't exist.
Code:
Function DltInvoice(CoName As Integer, InvType As Integer, InvDate As Date, Biweekly As String)
Dim logRec As Recordset
Set logRec = CurrentDb.OpenRecordset("logImportedFiles")
Dim dbs As Database
Set dbs = CurrentDb
strMsg = "This invoice does not exist, please check again"
logRec.FindFirst ("[CompanyID] = " & CoName & " AND [InvTypeID] = " & InvName & " AND [InvoiceDate] = " & InvDate & " AND [Biweekly] = " & Biweekly & "")
If logRec.NoMatch Then
MsgBox strMsg
Else: dbs.Execute "qryDLTInvoice"
End If
End Function