Private Sub pre()
Dim cnview As New ADODB.connection
Dim rsemployee As New ADODB.Recordset

Call connection(cnview, App.Path & "\Commissions.mdb", "endromida")
Call Recordset(rsemployee, cnview, "SELECT * FROM commi_cus WHERE sha_no ='" & txtShaha.Text & "'")

If recexist("commi_cus", "sha_no", txtShaha.Text, cnview) = True Then Call hlfocus(txtPrt): Exit Sub

With rsemployee

txtPrt.Text = .Fields!funa

End With
End Sub

You haven't provided us with the relevent code. You call connection, Recordset (a bad name for a sub, by the way) and recexist.

You haven't told us what line is generating the error.

You haven't even bothered to ask an actual question.

Please take the time to provide some information and we will try to give some help.

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.