OS = Windows XP
VB6 Enterprise Edition


I am using ADODB connection to conntect ACCESS 2000 Database

DATABASE Table field name Bill_Date data format date/Time

table filed contains values 20/12/2007 , 30/07/2007,..... ie (dd/mm/yyyy) format
billno in number format in table

In form i have a textbox name txtbilldate(to enter bill date for getting records)
table name sale_master

i wish apply query to find max(billno) on particular date

select max(billno) from Sale_master where bill_date = txtbilldate

Now my query is following but i could not get results please correct my code

Call OpenDB
Set rs1 = New ADODB.Recordset
rs1.Open "SELECT max(Billno) from Sale_Master where bill_date= "& txtbilldate &", cn, adOpenStatic, adLockPessimistic
If rs1.RecordCount <= 0 Then
txtbno.Text = 1
Elseif rs1.(0).value < 50
txtbno.Text = (rs1.Fields(0).Value + 1)
End If