Maybe what I'm trying to do is crazy. I want a function that does some of my recordset work that can be called from my sub routines in my program. I'd pass in the table name and the function would = the recordset.
private sub blah
'get an error here for invalid use of property
returnedrecordset = recordsetwork("Table Name")
end sub
Function recordsetwork(tabletosee As String)
Dim dbMyDB As Database
Dim rsMyRS As Recordset
Set dbMyDB = CurrentDb
Set rsMyRS = dbMyDB.OpenRecordset(tabletosee, dbOpenDynaset)
If Not rsMyRS.EOF Then rsMyRS.MoveFirst
Set recordsetwork = rsMyRS
End Function
private sub blah
'get an error here for invalid use of property
returnedrecordset = recordsetwork("Table Name")
end sub
Function recordsetwork(tabletosee As String)
Dim dbMyDB As Database
Dim rsMyRS As Recordset
Set dbMyDB = CurrentDb
Set rsMyRS = dbMyDB.OpenRecordset(tabletosee, dbOpenDynaset)
If Not rsMyRS.EOF Then rsMyRS.MoveFirst
Set recordsetwork = rsMyRS
End Function