Need advice on listbox or another way (1 Viewer)

miked1978

New member
Local time
Today, 00:19
Joined
May 22, 2020
Messages
25
I have a simple data entry form and one of the fields the user needs to input into is a Ticket# field which is set as a long text but in reality its between 10-15 characters (SQL server has it as nvarchar(255). The ticket number already exists and the user just needs to pick/input the correct one he is working.

I currently have the ticket # as a list box that is pointed to local table that contains all of the tickets. It works but the local table has over 30,000 records so as you can imagine the list box is quite full.

I guess my question is should I maybe do some type of validation where the user inputs the ticket # themselves and have some type of process that validates it against the table with all of the tickets in it to make sure its a good ticket? Or should I just leave it as a list box? It wouldn't be so bad if the user could type "159" and all the values that start with 159 would appear in the list box but its not working that way.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:19
Joined
Oct 29, 2018
Messages
21,454
Hi. Maybe you could implement some sort of a "search as you type" feature.
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:19
Joined
Sep 21, 2011
Messages
14,231
You could use @MajP FAYT class for the listbox?
A combo would work the same would it not?, but here is the FAYT demo in this thread.

 

miked1978

New member
Local time
Today, 00:19
Joined
May 22, 2020
Messages
25
You could use @MajP FAYT class for the listbox?
A combo would work the same would it not?, but here is the FAYT demo in this thread.


thanks. How would I implement it to my field? I copied the module to my DB but I don't see where he is calling the module in his form.
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:19
Joined
Sep 21, 2011
Messages
14,231
Have a look at his demo.
Basically it is one line to create a FAYT listbox as far as I recall? It is all done by classes.

Been a while since I implemented it?
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 01:19
Joined
May 21, 2018
Messages
8,525
You need code like
Code:
Public faytLst As New FindAsYouTypeListBox

'--------------------------------------- Needed To Create FAYT  -----------------------

Private Sub Form_Load()
  faytLst.Initialize Me.lstSearch, Me.txtSearch, "ProductName", ftlb_fromBeginning
End Sub

'Pass in a reference to the listbox, textbox, and optionally the field to search
'if you leave it blank it will search all fields. The last argument tells is to search
'from the beginning or anywhere in the string
 

Users who are viewing this thread

Top Bottom