aron.ridgway
Registered User.
- Local time
- Today, 23:36
- Joined
- Apr 1, 2014
- Messages
- 148
I have a Continuous form that is used to place orders in my Purchase order Database. I have a combo box with a Textbox over laid, so the users can type in the Textbox and it filters the combo box as they type. This is to search Nominal ledger codes that the current user has set up.
This has been working fine, but now finding issues as people have 400+ Nominal coeds set up. So there is a lag when the user is typing.
Is there a better way of doing this? i have a similar setup to search a supplier but this is not a continuous form and the majority of objects are un bound.
any help or pointers would be great.
My current code is :
This has been working fine, but now finding issues as people have 400+ Nominal coeds set up. So there is a lag when the user is typing.
Is there a better way of doing this? i have a similar setup to search a supplier but this is not a continuous form and the majority of objects are un bound.
any help or pointers would be great.
My current code is :
Code:
Private Sub lstSelect_AfterUpdate()
Me.lstSelect.RowSource = "qryCurrentNominalNew"
End Sub
Private Sub lstSelect_BeforeUpdate(Cancel As Integer)
Me.lstSelect.RowSource = "qryCurrentNominalNew"
End Sub
Private Sub lstSelect_Change()
Dim strText As String
Dim strFind As String
Dim i As Integer
Dim strSQL As String
strText = Me.lstSelect.Text
Debug.Print strText
strSQL = "SELECT tblNominal.PKnumber, [Name] & ""/"" & [NominalNumber] & ""/"" & [NominalCostCentre] AS Search, tblNominal.NominalNumber, tblNominal.Name, tblNominal.NominalCostCentre, tblUserNominal.UserFK, tblNominal.Company " & _
"FROM tblUserNominal INNER JOIN tblNominal ON tblUserNominal.NominalFK = tblNominal.PKnumber " & _
"WHERE [Name] & ""/"" & [NominalNumber] & ""/"" & [NominalCostCentre] Like '*" & strText & "*' AND tblUserNominal.UserFK = " & gUserID & " AND tblNominal.Company = '" & gCompany & "'" & _
"ORDER BY tblNominal.Name ;"
Debug.Print strSQL
Me.lstSelect.RowSource = strSQL
Me.lstSelect.Dropdown
End Sub
Private Sub lstSelect_Click()
Me.lstSelect.Requery
End Sub
Private Sub lstSelect_GotFocus()
Me.lstSelect.RowSource = "qryCurrentNominalNew"
Me.lstSelect.Dropdown
End Sub