Hi.
I have a form that pulls back info from an sql database -a picture, name, etc.
I setup a combobox that lists all the surnames and the user can find the user in that list and clikc and it loads.
However, it takes ages to load the record and often hangs the program.
But if I use the 'next record' button, it loads the record straight away so it isn't a connection issue.
Here is the code behind the combo/dropdownlist:
Any thoughts?
edit - oh, the sql VIew/query on the database returns about 2000 records. Not ideal I suppose for a combobox but what alternative is there for the end-user just to start typing 'Smith' and it gives them all the Smiths?
edit 2 - also, the combobox generates the data in the list straight away, it's when I click a record that the slowness kicks in.
I have a form that pulls back info from an sql database -a picture, name, etc.
I setup a combobox that lists all the surnames and the user can find the user in that list and clikc and it loads.
However, it takes ages to load the record and often hangs the program.
But if I use the 'next record' button, it loads the record straight away so it isn't a connection issue.
Here is the code behind the combo/dropdownlist:
Code:
Private Sub Searchbox_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Surname] = " & Chr(34) & Me![Searchbox] & Chr(34)
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
edit - oh, the sql VIew/query on the database returns about 2000 records. Not ideal I suppose for a combobox but what alternative is there for the end-user just to start typing 'Smith' and it gives them all the Smiths?
edit 2 - also, the combobox generates the data in the list straight away, it's when I click a record that the slowness kicks in.
Last edited: