S
SaskGuy
I have a number of subforms that relate to a single master form. I would like
to call a class that acts as a "dataservice" to get the record set for each
of the differnt pices of information. The problem is that I am not sure how
to make the module recordset equal the recordset from the class.
strSeed = Forms("station").Controls("txtstationid")
Set objrs = New Recordset
Set objrs = mDataService.GetRecordset(strSeed, "earthmat")
Where the mDataservice is the reference to my class and "earthmat" is the
name of the table.
The function in the class looks like this:
Function GetRecordset(strSeed As String, strTableName As String) As Recordset
Dim objrs As Recordset
Dim strQuery As String
strQuery = "Select * from " & strTableName & " where stationid = '"
& strSeed & "'"
objrs.Open strQuery, CurrentProject.Connection, adOpenDynamic,
adLockBatchOptimistic
GetRecordset = objrs
Return
objrs.Close
objrs = Nothing
End Function
Perhaps I am going beyond the abilities of Access 2000
Thanks in advance
to call a class that acts as a "dataservice" to get the record set for each
of the differnt pices of information. The problem is that I am not sure how
to make the module recordset equal the recordset from the class.
strSeed = Forms("station").Controls("txtstationid")
Set objrs = New Recordset
Set objrs = mDataService.GetRecordset(strSeed, "earthmat")
Where the mDataservice is the reference to my class and "earthmat" is the
name of the table.
The function in the class looks like this:
Function GetRecordset(strSeed As String, strTableName As String) As Recordset
Dim objrs As Recordset
Dim strQuery As String
strQuery = "Select * from " & strTableName & " where stationid = '"
& strSeed & "'"
objrs.Open strQuery, CurrentProject.Connection, adOpenDynamic,
adLockBatchOptimistic
GetRecordset = objrs
Return
objrs.Close
objrs = Nothing
End Function
Perhaps I am going beyond the abilities of Access 2000
Thanks in advance