Hi guy's stuck with this one, i can't understand why there is an error of Run time error 3061 too few parameters expected 1, can someone tell where i am going wrong ? i know there is data between the mStartDate and mEndDate
Code:
Dim MailAdd As String, mYes As String, mNo As String, fldExists As StringDim rs As DAO.Recordset, rs2 As DAO.Recordset, rs3 As DAO.Recordset, rs4 As DAO.Recordset, rs5 As DAO.Recordset, rs6 As DAO.Recordset
Dim mStartDate As Date, mEndDate As Date
Dim mYear As Long, mMonth As Long
mStartDate = Format((DateSerial(Me.txtCriteriaYear, Me.txtCriteriaMonth, 1)), "mm/dd/yyyy") 'Returns 1st day of month
mEndDate = Format((DateSerial(Me.txtCriteriaYear, Me.txtCriteriaMonth + 1, 0)), "mm/dd/yyyy") 'returns last day of month
mYes = "Yes"
mNo = "No"
MailAdd = "meathome.com"
mYear = Format(Me.txtCriteriaYear, "yyyy")
mMonth = Format(Me.txtCriteriaMonth, "mm")
Set rs = CurrentDb.OpenRecordset("Select tblInvoices.InvoiceDate, tblInvoices.Name, tblInvoices.InvoiceNumber, tblInvoices.CostOfJob, tblInvoices.VAT, tblInvoices.TotalAmount, tblInvoices.Paid, tblInvoices.PaidDate From tblInvoices WHERE InvoiceDate Between #" & mStartDate & "# And #" & mEndDate & "# ORDER BY InvoiceDate;")