B
BruceM
I have a Purchase Order database of standard design (Main PO table with a
related LineItems table; user interface form/subform).
Most of the time users will want to see a limited recordset when the PO form
loads. For instance, it may be that they want to see only POs for which
approvals are not yet complete, or POs after a certain date. It is not
clear yet exactly what recordset will be presented when the PO form loads,
but it will certainly not be all records in the PO table. However, there
will come times when users such as the financial people will want to see all
of the records, so the recordset needs to have all records available.
I suppose I could use a parameter query, but I would have to load the
recordset with the default parameters, then pass parameters from the Search
part of the form (unbound text boxes for selecting a single vendor's orders,
a date range, etc.) as needed. If I am to go that route I suspect it would
be better to redefine the recordset as a string (strSQL), then use
Me.Recordset = strSQL.
This brings me to a question. I hope I can ask it clearly. I believe that
any time I pass new parameters to a query it has the effect of reloading the
recordset. If so, building a recordset string strikes me as more efficient
way to go if the approach is to load a new recordset.
The other approach is to filter. Again, I would use the Seach text boxes to
build a filter string, then apply the string. Is this higher overhead than
reloading a recordset?
To summarize, the PO form will open with a limited recordset. The PO form
can be opened from several other forms. The recordset will differ depending
on the calling form. Is there an advantage one way or the other to loading
the recordset at run time, then redefining and reloading it as needed during
the user session?
Related question: If I go the recordset route rather than the filter route
I would list all of the fields when I build the SQL string. Most of the
string will be the same in all cases. Since I would have to build the
recordset from several events I would make that string a constant in the
Declarations section of the PO form's code module, unless there is a better
approach.
related LineItems table; user interface form/subform).
Most of the time users will want to see a limited recordset when the PO form
loads. For instance, it may be that they want to see only POs for which
approvals are not yet complete, or POs after a certain date. It is not
clear yet exactly what recordset will be presented when the PO form loads,
but it will certainly not be all records in the PO table. However, there
will come times when users such as the financial people will want to see all
of the records, so the recordset needs to have all records available.
I suppose I could use a parameter query, but I would have to load the
recordset with the default parameters, then pass parameters from the Search
part of the form (unbound text boxes for selecting a single vendor's orders,
a date range, etc.) as needed. If I am to go that route I suspect it would
be better to redefine the recordset as a string (strSQL), then use
Me.Recordset = strSQL.
This brings me to a question. I hope I can ask it clearly. I believe that
any time I pass new parameters to a query it has the effect of reloading the
recordset. If so, building a recordset string strikes me as more efficient
way to go if the approach is to load a new recordset.
The other approach is to filter. Again, I would use the Seach text boxes to
build a filter string, then apply the string. Is this higher overhead than
reloading a recordset?
To summarize, the PO form will open with a limited recordset. The PO form
can be opened from several other forms. The recordset will differ depending
on the calling form. Is there an advantage one way or the other to loading
the recordset at run time, then redefining and reloading it as needed during
the user session?
Related question: If I go the recordset route rather than the filter route
I would list all of the fields when I build the SQL string. Most of the
string will be the same in all cases. Since I would have to build the
recordset from several events I would make that string a constant in the
Declarations section of the PO form's code module, unless there is a better
approach.