Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autocomplete a field in a form

Status
Not open for further replies.

originalbling

IS-IT--Management
Jun 11, 2004
2
TT
Hi Everyone,

I am tyring to design a form to track Orders. I have fields at the top of the form and 2 tabbed subforms below. All the info. to be entered here relates to one Order.

The fields at the top are like this:
P.O. Number
Vendor Code
Vendor Name
Order amount etc.... then the tabbed s/forms follow.

I want the user to enter the PO#, then select a Vendor Code from a combo box (this get info. from the Vendors table), and the Vendor name must show up automatically w/o the user having to put it in. They would then continue and fill in Order amt. etc.

I have tried using an Autolookup query, but not getting that to work. I am only familiar with the basics of Access so any help will be most appreciated.

Thanks
 
Well, to begin with, your combo box probably already includes your vendor name yes? Like Vendor Code, Vendor Name, and maybe some other things.

Ok, assume that your combo box is called VendNo. If you make an unbound text box on the form (Unbound is best, since you don't want to store the name also with the vendor primary key)

Now, if you set the data source to =[VendNo].[Column](1) it will put the vendor name in the box when you select a vendor number from the list.

Note column(1) referes to the second column in the combo box, column 0 is the first.

ChaZ

Ascii dumb question, get a dumb Ansi
 
Thanks for the reply.
I don't like the idea of having a combo box with so much info stretching across.

I want to show only the Vendor Name & Vendor ID in the combo box. the unbound text boxes must then be able to fill in the other info. automatically.

Also, I must be able to add a new vendor if it's not there in the list. How can I do this? I have a command button on the form footer that opens the Vendor form, but when I add the vendor and return to my main form - the new vendor does not show up.

TIA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top