I have form on which there are three text boxes first is start date, second is end date and third is type
I am trying to write sql query in VBA to fetch data which is sum of inspection_Plan ned between two date(start date and end date)and then of particular type.
I have written following code to do it
i am having this code on button and on click of that button query does not produce result neither gives error
plz help
thanks
I am trying to write sql query in VBA to fetch data which is sum of inspection_Plan ned between two date(start date and end date)and then of particular type.
I have written following code to do it
Code:
Dim strSQL As String Dim rs As Recordset Set db = CurrentDb strSQL = "SELECT SUM(Inspection_Planned) From tblauditplanned WHERE ([Inspection_Palnned_Dte] Between " & Me.txtddjansd & " And " & Me.txtddjaned & ") AND [Inspection_Type] = ' & cmbsarepinsptype & ' " Set rs = db.OpenRecordset(strSQL) txtsarepjan1 = rs.Fields(0)
plz help
thanks
Comment