Dates must be delimited with #
, just as strings are delimited with "
. (This is unique to Access.)
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...)