E
edward
Surely this is a common situation, but I haven't been able to find a
discussion of it.
I'm processing in the click event procedure of a command control. I'm
going to open another form based on user inputs from the form. But if
the user input results in no records found, I want to display a MsgBox
instead of the form.
I can do that (and have done that) by using DCount with the same
criteria that I will pass to OpenForm.
But this query can sometimes be slow -- many seconds, even a minute or
two. When I do it this way, is Access running the query twice? Or is it
smart enough to keep the RecordSet from the first query lying around
and reuse it?
Is there a better way to handle this?
My first thought was to create a RecordSet, check if it's empty, and
pass it to the form. But my searching indicates that this lies
somewhere between difficult and impossible, especially since I'm using
ADO (due to possibly needing to move the back end in the future).
Edward
discussion of it.
I'm processing in the click event procedure of a command control. I'm
going to open another form based on user inputs from the form. But if
the user input results in no records found, I want to display a MsgBox
instead of the form.
I can do that (and have done that) by using DCount with the same
criteria that I will pass to OpenForm.
But this query can sometimes be slow -- many seconds, even a minute or
two. When I do it this way, is Access running the query twice? Or is it
smart enough to keep the RecordSet from the first query lying around
and reuse it?
Is there a better way to handle this?
My first thought was to create a RecordSet, check if it's empty, and
pass it to the form. But my searching indicates that this lies
somewhere between difficult and impossible, especially since I'm using
ADO (due to possibly needing to move the back end in the future).
Edward