Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recordset as parameter (type mismatch)

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Here is a simple project with a reference to the Microsoft ActiveX Data Objects Recordsets 2.5 library.

Why the type mismatch when function a is called.

Private Sub Command1_Click()
Dim rs As Recordset
Set rs = New Recordset
a (rs) 'here is where the type mismatch occurs
End Sub

Function a(rs As Recordset)
MsgBox "a"
End Function
 
You need to take out the brackets.

rs = a (rs) is ok. The value is being returned to rs variable.

a rs is the way to go since you're not assigning values.

Delton.
deltonphillips@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top