DataFieldToDisplay

W

willjay

When constructing a lookup field when designing tables, and you select a
combo to use to display, how do you set to display a particular field in the
the lookup table in the combo. I know how to get it to drop down the list
but it shows the primary key (ID) which is the value store, and that is ok,
but I want to display another field.

Help appreciated,
wj
 
J

Jeff Boyce

If I understand what you're trying to do correctly, you wish to use a table
and a lookup datatype, but display a different field.

Tables are for storing data, forms for displaying data. A review of this
newsgroup (tablesdbdesign) will reveal a strong consensus both against using
tables for data entry/viewing (use forms instead), and against using the
lookup datatype (use forms and a combo box instead).

Good luck

Jeff Boyce
<Access MVP>
 
W

willjay

Actually, what I am looking for is a place to store the "field to display"
within the table structure. This information would be made available to an
component in vb.net we are creating to display a virtual form, adjusting
itself to the structure of the underlying table.

The component parses the structure of the Acesss table and creates the
virtual form which doesn't store any data within the acesss table, but
rather stores the data in an identical table within an mssqlserver.

The purpose of using the acesss structure is that access table structures
contains all the necessary values to create lookups and such and this method
allows us to also use the component to update access tables if needed. In
other words we are using an access db to distribute along with our
application that stores nothing but the table structure.

The component maps the access table structure, gleans all the properties,
including lookup information for foreign tables and this method allow for
easy changes to the way data is displayed mealy by adjusting the table
structure as needed.

My alternatives would be to put this information in an external table
structure, which is at best messy, or worse imbed within the application,
resulting in needing a new application if there is a change. I am quite
aware that Microsoft has thousands of examples of doing this by creating
application with all sorts of lookup information included as part of code.
I just happend to believe that this is just plain bad programming

I also believe that the table structure should contain all of the necessary
information to display, and glean data entry from the user other tables and
other database. MS Sqlserver is just plain deficient in table structure
features. Access is better.

An access table has a field in the lookup structure called boundcol, what I
was hoping for is a DisplayCol field. But I don't see one.

The rewards for creating our virtual form component, which we have already
created is that you can with one form display and manage thousands of tables
..

wj
 
J

Jeff Boyce

I'm not aware of such, but who knows what's "behind the curtain"?!

Perhaps other 'group readers can offer approaches...

Jeff Boyce
<Access MVP>
 
L

Lynn Trapp

I'm not sure this is what you are looking for, but in a combobox the first
"visible" field in the query for the lookup is the one that displays on the
form or, in your case the table. If you set the column width of your key
field to 0" and the width of the field you want to display to something
larger than 0, then that field should be displayed instead of the key field.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Security FAQ: http://support.microsoft.com/support/access/content/secfaq.asp
 
W

willjay

What I may have to do is parse the fieldwidths as you suggest and use the
first encounter of > 0 as our visible field. Thanks for the suggestion.
 

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

Top