G
Guest
I'm using Access 97 and trying to write a function. I am calling the
function from a query and am passing several arguments to the function - one
of which is a key field (MSET_ID). In the code I have:
------------------
Dim db as DAO.Database
Dim rst as DAO.Recordset
Set db = CurrentDb()
some other code that works fine...
Set rst = db.OpenRecordset("Select * from qryRunTime Where MSET_ID = " &
lngMSET) 'key field passed to function
rst = Nothing
db = Nothing
------------------
Using the debug.print rst.RecordCount I discovered that the recordset only
has 1 record when it should have several based on the key field. The
qryRunTime is a simple select query. Where am I going wrong with this?
I guessing this isn't the most efficient process. For each record in the
query, it needs to open a recordset. Is this aspect ok?
Thanks
function from a query and am passing several arguments to the function - one
of which is a key field (MSET_ID). In the code I have:
------------------
Dim db as DAO.Database
Dim rst as DAO.Recordset
Set db = CurrentDb()
some other code that works fine...
Set rst = db.OpenRecordset("Select * from qryRunTime Where MSET_ID = " &
lngMSET) 'key field passed to function
rst = Nothing
db = Nothing
------------------
Using the debug.print rst.RecordCount I discovered that the recordset only
has 1 record when it should have several based on the key field. The
qryRunTime is a simple select query. Where am I going wrong with this?
I guessing this isn't the most efficient process. For each record in the
query, it needs to open a recordset. Is this aspect ok?
Thanks