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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookup Fields

Status
Not open for further replies.

7Oclock

Programmer
Mar 9, 2005
12
0
0
US
I want to make a combo box that allows you to type manually or select from what was typed in before. So that the list of choices comes from entries already in the database for the same field. Can this be done? In combo boxes can't you have a pulldown or type in the entry?
 
I'm not sure to have well understood your issue.
Anyway take a look at the AutoExpand, LimitToList and NotInList properties/event of the ComboBox object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi,
Yes it can be done. Open your form in design view. Make sure your control wizard button (the magic wand) is enabled.

Then click on the new combo box icon. Drag to a spot on your form. When prompted, select, "I want the combo box to look up the values in a table or query." Select the table or query that has the data you want in your combo box. Select the field(s) you want to have apear in your combo box.

See how that works. :)
 
The problem, Christineeve, is that the table I want to get the values from is the same table I'm writing to and that table is not listed by the wizard.
 
And what about the 3rd option of the combo wizard ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
The problem, Christineeve, is that the table I want to get the values from is the same table I'm writing to and that table is not listed by the wizard (thought I would post this again).
 
Is the table in another database? If it is you will have to link it into this database before you can use it.

 
Hi,
I think I understand what you've said. You're pulling the values from the table which you are also writing to from the form.

I have also done this to allow users to select data that's already been entered as well as add new data from the combo box to the table(s).

What I don't understand is why the table doesn't appear in your list to pick from in the wizard. The wizard should show all tables and queries in your current database, I can't think of a case where it wouldn't unless it's a hidden table.

Anyway, if you have created this table, e.g. tblEmployees, it should appear in your list. Make sure you've clicked on the radio button, "Tables" or "Both" which pulls all the tables from the current DB or all tables and all queries in the case of "Both." I'm sure you've done this but just in case you overlooked it.... :)

It doesn't sound like the table is from another database, but maybe it is? If so, like Ascentient said, you'll have to link it.

I hope you figured it out. :)
 
why in a combo box or lookup column, I get the primary key (which is the auto number) instead of the customer's name its related to? Im trying to make a relationship, but it says something about indexing
 
In the combo boxes properties under the formats tab what is the 'colomn count' set to and what does it have for the 'colomn widths'? Under the data tab, what does it say for 'row source'?

Program Error
Programmers do it one finger at a time!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top