|
-
Jan 21st, 2000, 06:30 AM
#1
Thread Starter
Hyperactive Member
I have a form with several text boxes that are populated through code from a database. This form is accessing a customer table that I have set up on the database. What I want to be able to do, is have the text box autocomplete the customer's name as you type it. Meaning that it would have to sort the names in the database and be able to run through them as you type. Aaron Young gave me some code that would do something similar with a text box and a list box. I suppose I could do the same thing, but I think that would slow it way down, if I took the time to first read every customer off the table and then populate a listbox. Is there any other way to do it? I have the names broken down into:
- Company Name
- Last Name
- First Name
- Middle Initial
All four of these are separate columns in the table, and I need to be able to search them all. Thank you so much for your help.
------------------
Ryan
[This message has been edited by Gimpster (edited 01-21-2000).]
-
Jan 21st, 2000, 07:31 AM
#2
You could do an SQL Like but that would probably be too slow. I don't know what Aaron suggested, but his suggestions are rarely improved on.
------------------
Marty
Can you buy an entire chess set in a pawn shop?
-
Jan 21st, 2000, 08:00 AM
#3
Thread Starter
Hyperactive Member
Hehehehe, very true Marty. Thanks for the advice, I guess I'll just have to list all the names in a text box, and go from there. Thanks again.
------------------
Ryan
-
Jan 22nd, 2000, 10:29 PM
#4
Member
If you loaded up arrays with all company name, first name, last name, & middle initial possiblities at startup, you could then check thru each array element as you're typing much faster than requerying the database. Populate an array for each column of data. The only danger would be someone else adding/deleting a database entry while you're app is running. If this is not a problem then you'd see a big speed increase by populating arrays at Form_Load.
Hope this helps,
Dan
[This message has been edited by mcleran (edited 01-23-2000).]
-
Jan 23rd, 2000, 04:39 AM
#5
Guru
You could also use a disconnected recordset and use the recordset's SEEK/FIND methods to search thru your database, without affecting network traffic (if over a network). That is usually pretty fast and much more flexible than an array.
-
Jan 24th, 2000, 08:07 AM
#6
Thread Starter
Hyperactive Member
Clunietp, what do you mean by a "disconnected recordset"? How would you do something like that?
------------------
Ryan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|