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

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
 
N

NetworkTrade

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...
 
J

John Vinson

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]
 
C

cynic

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top