D
Dennis Snelgrove
I've got a form whose RecordSource is a query with a User-Defined
Function in it. The UDF is passed the current record's Primary key,
then it has to run another DAO recordset in order to check for
follow-up records in the same table. The table is of course getting
bigger all the time as new entries are added, and so far it's up to
about 45000 records. The form is limited to the last 14 hours of
entries, as a default, so there aren't usually more than 30-40 entries
in the detail. The trouble is that it takes about 5-8 seconds for the
form to finish updating the recordset, and I think much of the reason
is due to all the repetitive recordset work. I figure that it might
speed things up if I created a DAO recordset as a global form-level
variable in the main form, then in the Form_Open event I can set it to
mirror the recordsource of the Detail. I can then use this variable
directly in my UDF, thereby saving a lot repetitive scanning of the
main table. In addition, it would save on a lot of traffic over the
network to the back-end file. I know that I can create a local table in
the front-end and append the records into it, but this strikes me as
more work than just using a variable that will disappear when the form
is closed. I'd have to keep doing a complete Delete on the contents,
then an Append of the info over again. An object I can simply Requery
when there are new entries added.
So, my question is this: if I have an object, say rstRecordDetail, and
I want to use it as the recordsource in another query, how do I
reference it? I've tried the following with no luck.
SELECT * FROM rstRecordDetail;
Thanks for any help...
Function in it. The UDF is passed the current record's Primary key,
then it has to run another DAO recordset in order to check for
follow-up records in the same table. The table is of course getting
bigger all the time as new entries are added, and so far it's up to
about 45000 records. The form is limited to the last 14 hours of
entries, as a default, so there aren't usually more than 30-40 entries
in the detail. The trouble is that it takes about 5-8 seconds for the
form to finish updating the recordset, and I think much of the reason
is due to all the repetitive recordset work. I figure that it might
speed things up if I created a DAO recordset as a global form-level
variable in the main form, then in the Form_Open event I can set it to
mirror the recordsource of the Detail. I can then use this variable
directly in my UDF, thereby saving a lot repetitive scanning of the
main table. In addition, it would save on a lot of traffic over the
network to the back-end file. I know that I can create a local table in
the front-end and append the records into it, but this strikes me as
more work than just using a variable that will disappear when the form
is closed. I'd have to keep doing a complete Delete on the contents,
then an Append of the info over again. An object I can simply Requery
when there are new entries added.
So, my question is this: if I have an object, say rstRecordDetail, and
I want to use it as the recordsource in another query, how do I
reference it? I've tried the following with no luck.
SELECT * FROM rstRecordDetail;
Thanks for any help...