autofill rest of name and primary key after adding 1+ letter

  • Thread starter Thread starter bwall
  • Start date Start date
B

bwall

I'm setting up a form and was wondering how to make some of the tex
fields autofill the remaining characters after I enter one or more o
them. I don't want to have to type a persons name or ID in full
everytime that I have to enter information into my table fo
billing

Example would be having it set up sort of like the url address bar i
IE. Once you start typing you end up getting a list or the rest o
the characters needed for a common entry
 
I believe a listbox (based on a table of names) should allow you to pulldown
or type with autofill....though that may depend on the version of access. I
am pretty sure that using Access xp that it works this way...
 
I believe a listbox (based on a table of names) should allow you to pulldown
or type with autofill....though that may depend on the version of access. I
am pretty sure that using Access xp that it works this way...

Correct - but it's a Combo Box which does this, not a Listbox.

John W. Vinson[MVP]
 
Hope this helps :

If you add a listbox and give it a rowsource of "SELECT <fields> FROM
<table> WHERE <field> Like '*' & [Forms]![formname]![textboxname] & '*';"

In the textbox create a KeyUp or AfterUpdate event that has the following
code :

With Listbox
.Value = ""
.RowSourceType = "Table/Query"
.RowSource = "SELECT <fields> FROM <table> WHERE <field> Like '*' &
[Forms]![formname]![textboxname] & '*';"
End With

in order to refilter the listbox.

change the tab order to go from the text box to the list box and in the list
box properties add an OnClick event with the code:

Private Sub Listboxname_Click()
textboxname = Me.Listboxname.Column(1)
End Sub
 
Back
Top