Dates must be delimited with
#, just as strings are delimited with
". (This is unique to Access.)
Code:
rs1.Open "SELECT MAX(Billno) " & _
"FROM Sale_Master " & _
"WHERE bill_date = #"& txtbilldate & "#", ...
(Incidentally, your quote after âtxtbilldateâ resumes creating a literal string.
â, cn, adOpenStatic, adLockPessimisticâ would be considered part of the string, not additional arguments for the .open method, and
VB would supply the closing quoteâjust
VBâs way of being helpful...)