VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Simple AutoComplete TextBox

Darrin  (1 Submission)   VB function enhancement   Visual Basic 3.0   Beginner   Wed 3rd February 2021

This code will autofill a textbox from a database table using the keyup event.

Inputs
User input into textbox and database via ADODB recordset.

Returns
It will autofill the textbox with the the first match of the letters the user types in.

Side Effects
I used the keyup event to keep it very simple, although if a user types quickly, and presses a key before the previous key is released (keyup'd), it will cause and error and clear the textbox.

API Declarations
Place the variables that are in ALL CAPS as global variables, and set STRNAME = "" and the INTPLACE = 0 on the GotFocus and the LostFocus events of the textbox.
You will also need to set "cn" = to an ADODB connection to your database.

Rate Simple AutoComplete TextBox (4(4 Vote))
Simple AutoComplete TextBox.bas

Simple AutoComplete TextBox Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters