tehvilinaty
New member
- Local time
- , 21:59
- Joined
- Jun 25, 2018
- Messages
- 9
I have a front end created in MS Access and a backend in SQL Server, the server is remote and the frontend connects to it over the internet. I have a combobox in a rather large form with multiple subforms in it.
The combobox contains names of customers, when someone types in it I wrote code to filter the names, that way it can show names even if part of it is typed. It works well but it's a bit slow. Trying to find out what is causing the delay I encountered this "issue":
The subforms have a master/child relationship with the main form, but if I remove the relationship, or delete the subforms completely, then the combobox filtering gets significantly faster. The combobox is bound to the "CustomerID" field of the form, so selecting a name on the combobox will store the CustomerID on the Order table, but the subforms use OrderID for their relationship and not CustomerID. Further, if I unbound the combobox, so it doesn't store anything anywhere, I still get delays.
This is my code for the on-change sub of the combobox (it's called CustomerCombo):
Private Sub CustomerCombo_Change()
Dim sSQL As String
sSQL = "SELECT Customers.ID, Customers.CustomerName, Customers.Phone, Customers.Email FROM Customers WHERE Customers.CustomerName LIKE '*" & CustomerCombo.Text & "*';"
CustomerCombo.RowSource = sSQL
CustomerCombo.Dropdown
End Sub
It's as if all my subforms are refreshing every time I press a key inside the combobox
The combobox contains names of customers, when someone types in it I wrote code to filter the names, that way it can show names even if part of it is typed. It works well but it's a bit slow. Trying to find out what is causing the delay I encountered this "issue":
The subforms have a master/child relationship with the main form, but if I remove the relationship, or delete the subforms completely, then the combobox filtering gets significantly faster. The combobox is bound to the "CustomerID" field of the form, so selecting a name on the combobox will store the CustomerID on the Order table, but the subforms use OrderID for their relationship and not CustomerID. Further, if I unbound the combobox, so it doesn't store anything anywhere, I still get delays.
This is my code for the on-change sub of the combobox (it's called CustomerCombo):
Private Sub CustomerCombo_Change()
Dim sSQL As String
sSQL = "SELECT Customers.ID, Customers.CustomerName, Customers.Phone, Customers.Email FROM Customers WHERE Customers.CustomerName LIKE '*" & CustomerCombo.Text & "*';"
CustomerCombo.RowSource = sSQL
CustomerCombo.Dropdown
End Sub
It's as if all my subforms are refreshing every time I press a key inside the combobox