I'm an intermediate vb programmer, i need help . I wrote a code that'll fetch a particular employee id (EM_ID) and print the report but its saying this whenever i compile and run.
Runtime Error 2147217904 [80040e10] [ODBC Microsoft Access Driver] Too few parameters
The code is below
rs.Open "SELECT tblPayroll.EM_ID, tblPayroll.EM_Name, tblPayroll.Monthly_Rate, tblPayroll.dDate, tblPayroll.Bonus, tblPayroll.OvertimePay, tblPayroll.AwardTicket, tblPayroll.FineTicket, tblPayroll.pension, tblPayroll.w/Tax, tblPayroll.OtherDeductions, tblPayroll.OtherEarnings, tblPayroll.Loans, tblPayroll.TotalDeductions, tblPayroll.Medical, tblPayroll.Housing, tblPayroll.Transport, tblPayroll.Furniture, tblPayroll.Feeding, tblPayroll.Miscellaneous, tblPayroll.NetPay, tblPayroll.RemainingBalance, tblPayroll.TotalPaid, tblPayroll.LoanCollected, tblPayroll.MonthlyDeduction " & _
"FROM tblPayroll WHERE EM_ID =" & Me.lvwInfo.SelectedItem.Text & " GROUP BY tblPayroll.EM_ID, tblPayroll.EM_Name, tblPayroll.Monthly_Rate, tblPayroll.dDate, tblPayroll.Bonus, tblPayroll.OvertimePay, tblPayroll.AwardTicket, tblPayroll.FineTicket, tblPayroll.pension, tblPayroll.w/Tax, tblPayroll.OtherDeductions, tblPayroll.OtherEarnings, tblPayroll.Loans, tblPayroll.TotalDeductions, tblPayroll.Medical, tblPayroll.Housing, tblPayroll.Transport, tblPayroll.Furniture, tblPayroll.Feeding, tblPayroll.Miscellaneous, tblPayroll.NetPay, tblPayroll.RemainingBalance, tblPayroll.TotalPaid, tblPayroll.LoanCollected, tblPayroll.MonthlyDeduction having Month(dDate)='" & Month(Me.dt1.Value) & "' And Day(dDate)='" & Day(Me.dt1.Value) & "' And Year(dDate)='" & Year(Me.dt1.Value) & "' ORDER BY tblPayroll.EM_ID;", cn, adOpenKeyset, adLockPessimistic