Code:
S = "select count(*) as aa from no_of_pracs where " S = S & "batch like '" & pracs_1(0) & "' and " S = S & "month_of_pracs ='" & MonthView1.Month & "'" Adodc1.RecordSource = S Adodc1.Refresh Adodc1.Recordset.MoveFirst b = Adodc1.Recordset.Fields(0).Value