This might seem to be simple to the more advanced of you out there, but I seem to have some problems with this (read: getting errors).
I have a recordset of a table, and I then want to pass the whole recordset (all the fields) to a function where I need to process the data.
Well it actually seems like I'm able to pass the recordset to a function, but then again maybe not, because I get an error when I try to read the first field:
Compile Error:
Method or data member not found
My Function is defined like this:
Private Function MyFunction(rst As DAO.Recordset)
and I try to access a particular field in the
recordset (table) like this:
myString=rst.txtSiteName
The recordset is defined like this:
Dim rstDetails As DAO.Recordset
and I open it this way where "Selection" is the SQL string:
Set rstDetails = CurrentDb.OpenRecordset(Selection)
and I call it like this:
strComplete=MyFunction(rstDetails)
What am I doing wrong here?
I have a recordset of a table, and I then want to pass the whole recordset (all the fields) to a function where I need to process the data.
Well it actually seems like I'm able to pass the recordset to a function, but then again maybe not, because I get an error when I try to read the first field:
Compile Error:
Method or data member not found
My Function is defined like this:
Private Function MyFunction(rst As DAO.Recordset)
and I try to access a particular field in the
recordset (table) like this:
myString=rst.txtSiteName
The recordset is defined like this:
Dim rstDetails As DAO.Recordset
and I open it this way where "Selection" is the SQL string:
Set rstDetails = CurrentDb.OpenRecordset(Selection)
and I call it like this:
strComplete=MyFunction(rstDetails)
What am I doing wrong here?