jmstarbuck
Programmer
I have a form that the user is allowed to "filter" in various ways. I accomplish this by creating a query based on their selections, using that query to open a recordset to make sure it returns rows and then setting the form's record source equal to that query text.
At first I was working with actual filtering but I ran into problems, got frustrated, and changed my approach. This seems to work, but I am open to suggestions.
Now that I have the form using the desired recordset, I would like to create various combo boxes listing data from that recordset in various orders.
Currently, I am setting the rowsource of the combo boxes = to a query incorporating the form's record source query. The problem is that the query includes multiple sub queries and is slow. Is there a way to simply query agaist the form's current recordset when creating my combo boxes?
Any guidance would be appreciated.
J
Code:
dim r as object
r.Open FilterSelectText, CodeProject.Connection, adOpenStatic
GENNumRecs = r.RecordCount
If (r.EOF And r.BOF) Then
MsgBox ErrMessage, vbOKOnly, "NO DATA"
Else
filtertext = filterSelectWhere
Me.RecordSource = FilterSelectText
Me.Requery
'Set Me.Recordset = r
Me!recordsetinfo = "(of " & GENNumRecs & ")"
End If
At first I was working with actual filtering but I ran into problems, got frustrated, and changed my approach. This seems to work, but I am open to suggestions.
Now that I have the form using the desired recordset, I would like to create various combo boxes listing data from that recordset in various orders.
Currently, I am setting the rowsource of the combo boxes = to a query incorporating the form's record source query. The problem is that the query includes multiple sub queries and is slow. Is there a way to simply query agaist the form's current recordset when creating my combo boxes?
Any guidance would be appreciated.
J