I have an SQL statement on a listbox which displays cash receipt tickets. In the event the user enters a date range where there are no records i get the Invalid use of null error.. How can i force it to either display nothing or a msgbox saying there is no records. Here is my statement..
SQL = " SELECT CashReceiptTicket.TicketID, CashReceiptTicket.BankAccount, CashReceiptTicket.TypeOfDeposit, CashReceiptTicket.TotalDeposit," & _
" CashReceiptTicket.TicketCount, CashReceiptTicket.ID FROM CashReceiptTicket" & _
" WHERE (((CashReceiptTicket.DepositDate) Between [Forms]![CRMain]![CRdaterange1] And [Forms]![CRMain]![CRdaterange2]))" & _
" ORDER BY CashReceiptTicket.TicketID DESC , CashReceiptTicket.DepositDate DESC;"
SQL = " SELECT CashReceiptTicket.TicketID, CashReceiptTicket.BankAccount, CashReceiptTicket.TypeOfDeposit, CashReceiptTicket.TotalDeposit," & _
" CashReceiptTicket.TicketCount, CashReceiptTicket.ID FROM CashReceiptTicket" & _
" WHERE (((CashReceiptTicket.DepositDate) Between [Forms]![CRMain]![CRdaterange1] And [Forms]![CRMain]![CRdaterange2]))" & _
" ORDER BY CashReceiptTicket.TicketID DESC , CashReceiptTicket.DepositDate DESC;"