I Want if my Purchase form should come at form_load the last value
of req. no should come in text box .
i have written a code :
Private Sub Form_Activate()
Set rs = New adodb.Recordset
rs.Open " select max(req_no) from po", con, adOpenDynamic, adLockOptimistic
Text12.Text = rs!req_no
End Sub

but got run time error 3265
Kindly help me

i think this is wrong

Text12.Text = rs!req_no

i think this is wrong

Text12.Text = rs!req_no

if this is wrong then what is right my friend.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.