PC Review


Reply
Thread Tools Rate Thread

Display Combo Box Text Instead of Key in Table

 
 
=?Utf-8?B?QWRyaWFu?=
Guest
Posts: n/a
 
      5th Nov 2007
I have a form with basic member information. One item is Status. I created
a table title Status listing the various types of status available and
inserted a combo box in my form that references this table. However, I store
the result in another table called claim information which contains
information related to that specific member (related by ID). If I view the
record in the claim information table, it shows the primary key from the
Status table (column 0) and not the value displayed on the form (column 1).
While I realize this is technically correct, I would prefer if the table
would show the value rather than a numerical key that has no meaning. This
would make trouble shooting easier. Is it possible? If it is but is not
adviseable, please explain

Thanks
Adrian
 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2VuIFNoZXJpZGFu?=
Guest
Posts: n/a
 
      5th Nov 2007
Adrian:

It can be done in raw datasheet view of the table by setting the Display
Control on the Lookup tab of the column's properties sheet to a combo box,
but I'd advise against it. In any database application the interface with
the data should be via forms or reports not directly with the datasheet view
of the table, which, for the rare occasions, e.g. when debugging, when a
developer might wish to view it, is better left showing the actual values
stored rather than those to which they map in another table. To save time
you can create a simple autoform very easily then amend its design, or you
can use the form wizard for more detailed control.

Rather than basing a form on the table per se its usually better to base it
on a query. That way you can for instance sort the query so that the rows
appear in a meaningful order, in your case ordered by LastName then FirstName
for instance.

As regards your specific problem use a combo box bound to the StatusID
foreign key column with a RowSource such as:

SELECT StatusID, StatusType
FROM Status
ORDER BY StatusType;

Set its other properties as follows:

BoundColumn 1
ColumnCount 2
ColumnWidths 0cm;8cm (or rough equivalent in inches but the first
dimension must be zero to hide the first, Status, column, so only the text
StatusType shows)

In a report don't use a combo box (although it is possible) but base the
report on a query which joins the Members table to the Status table on
StatusID and bind a text box to the StatusType column from the Status table.

Ken Sheridan
Stafford, England

"Adrian" wrote:

> I have a form with basic member information. One item is Status. I created
> a table title Status listing the various types of status available and
> inserted a combo box in my form that references this table. However, I store
> the result in another table called claim information which contains
> information related to that specific member (related by ID). If I view the
> record in the claim information table, it shows the primary key from the
> Status table (column 0) and not the value displayed on the form (column 1).
> While I realize this is technically correct, I would prefer if the table
> would show the value rather than a numerical key that has no meaning. This
> would make trouble shooting easier. Is it possible? If it is but is not
> adviseable, please explain
>
> Thanks
> Adrian


 
Reply With Quote
 
=?Utf-8?B?QWRyaWFu?=
Guest
Posts: n/a
 
      5th Nov 2007


"Ken Sheridan" wrote:

> Adrian:
>
> It can be done in raw datasheet view of the table by setting the Display
> Control on the Lookup tab of the column's properties sheet to a combo box,
> but I'd advise against it. In any database application the interface with
> the data should be via forms or reports not directly with the datasheet view
> of the table, which, for the rare occasions, e.g. when debugging, when a
> developer might wish to view it, is better left showing the actual values
> stored rather than those to which they map in another table. To save time
> you can create a simple autoform very easily then amend its design, or you
> can use the form wizard for more detailed control.
>
> Rather than basing a form on the table per se its usually better to base it
> on a query. That way you can for instance sort the query so that the rows
> appear in a meaningful order, in your case ordered by LastName then FirstName
> for instance.
>
> As regards your specific problem use a combo box bound to the StatusID
> foreign key column with a RowSource such as:
>
> SELECT StatusID, StatusType
> FROM Status
> ORDER BY StatusType;
>
> Set its other properties as follows:
>
> BoundColumn 1
> ColumnCount 2
> ColumnWidths 0cm;8cm (or rough equivalent in inches but the first
> dimension must be zero to hide the first, Status, column, so only the text
> StatusType shows)
>
> In a report don't use a combo box (although it is possible) but base the
> report on a query which joins the Members table to the Status table on
> StatusID and bind a text box to the StatusType column from the Status table.
>
> Ken Sheridan
> Stafford, England
>
> "Adrian" wrote:
>
> > I have a form with basic member information. One item is Status. I created
> > a table title Status listing the various types of status available and
> > inserted a combo box in my form that references this table. However, I store
> > the result in another table called claim information which contains
> > information related to that specific member (related by ID). If I view the
> > record in the claim information table, it shows the primary key from the
> > Status table (column 0) and not the value displayed on the form (column 1).
> > While I realize this is technically correct, I would prefer if the table
> > would show the value rather than a numerical key that has no meaning. This
> > would make trouble shooting easier. Is it possible? If it is but is not
> > adviseable, please explain
> >
> > Thanks
> > Adrian

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting form combo box data to display in table Shel Microsoft Access 1 17th Jun 2009 04:44 PM
Display only part of table in combo box frederick Microsoft Access Forms 2 27th Feb 2008 06:53 PM
Combo Box does not display data from table until it gets focus =?Utf-8?B?bWpi?= Microsoft Access Forms 0 16th Sep 2006 11:14 PM
Want combo box to display 3 fields from my table but only displays one vanilla_bean_orange via AccessMonster.com Microsoft Access Form Coding 3 16th Jan 2006 10:20 AM
Display Text in combo box =?Utf-8?B?TW9zaGlrIEFtaXQ=?= Microsoft Access Forms 1 5th Dec 2004 09:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:23 PM.