ok let me show the entire code so you have a better sense of what i'm trying to do.
code in module
Public Sub SqlSearch(frm As Access.Form, intYear, intMonth, intLedgerID, intBank)
Dim Ayear, Amonth, Adays, LedgerID, BankID As Integer
Dim AfirstDay, AfirstDate, AendingDate, qrySccID, UD As...