Which box to use

ajm

Registered User.
Local time
Today, 22:36
Joined
Oct 6, 2006
Messages
16
Hi
I've used Access as a datasource to websites for a few years now, but never with an Access Form before.
I have a table with a Foreign Key set up to link back to a second table (with id and textfield).
I have built a form for the first table and want a combo/list box to display the details from the second table and store the id in the field in the first table.
If I use a Combo box I get the ID displaying.
If I use a Listbox I have to declare both the textfield and the id, and both display in the box.
Can I link the two tables, and have a Combo/List box that just displays the textfield ?
And if so - do I need to write some code behind the form or can Access manage it all for me ?
cheers
ajm
 
You can control what column your ComboBox is displaying.

In its control source, you would include two fields (in this order): ID, Textfield

You would then set the bound column to 1. Under format, set the column count to 2, and set the column widths to 0"

This will hide the first column, and only display the second.
 
The combo box actually displays the first field with a non zero length. You can use this advantageously, by setting the length of the second column to 0.1 which effectively hides it, but you can then populate the second column with eg concatenated information from several later columns.
 
i meant hides it from the drop down, but displays it in the combo box as the selected item - (which displays the value in the first non zero length column)
 

Users who are viewing this thread

Back
Top Bottom