I have a form which lets you type in criteria to search a table by.
On that form I have textboxes that I bind to that recordset after they input their criteria and hit a search button.
VB Code:
Private Sub cmdSearch_Click() If rsSearch.State = 1 Then rsSearch.Close rsSearch.Source = "SELECT * FROM MyTable WHERE MyField = '" & txtSearch.Text & "'" rsSearch.Open , connDB, adOpenStatus, adLockOptimistic Set textbox1.Datasource = rsSearch End Sub
Now, I have about 30 controls with the datafields already set that I set the datasource to that recordset. It works fine..
My problem is, when they search a second time it goes REALLY slow. The only way I found to fix this was to set the controls datasource to Nothing before setting it to the RS.
Seemed to work great until I watched the memory usage go UP UP UP every time you searched. It does not do that if dont set the controls datasource to Nothing first though.. What can I do?? HELP!




Reply With Quote