Display question (1 Viewer)

Peter Paul

Registered User.
Local time
Today, 04:13
Joined
Jan 1, 2000
Messages
82
Greetings, I am attempting to do something which I am sure is easy to do, but I cannot get my mind around it. I have a dropdown field which shows codes and a description for the field. I have the field storing the codes, because that is the data which is significant.

However, when a person is reading the report, I do not want them to have to know what the code means. So, I want to have a description field on the form, which automatically populates with the text description for the code.

How can I accomplish this?

As always, thankyou for your assistance,

Peter Paul
 

Alexandre

Registered User.
Local time
Today, 10:13
Joined
Feb 22, 2001
Messages
794
Seems to be a better approach to build a combobox control base on the two fields (key and description) but showing only the description to the user while actually using and storing the key (hidden).
This is a common feature of A2K and you have wizards for this (at the level of controls, but also at the level of the table by using create list).

If your version of access don t have, post and i ll explain how to do it manually.
 

Peter Paul

Registered User.
Local time
Today, 04:13
Joined
Jan 1, 2000
Messages
82
I am using Access 97, so the wizard does not show me how to do this. Thanks in advance for your help

Peter Paul
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 23:13
Joined
Feb 19, 2002
Messages
43,484
Change the report's recordsource to be a query that joins the main table to the "look up" table. That way the description will be available in the report's recordsource and you can place it directly on the report. If you are already using a query as the recordsource you'll need to follow the following steps to get the report to "see" the new description field.

1. Open the report in design vied
2. Delete the recordsource
3. Save the report
4. Put the query reference back into the recordsource
5. Save the report
 

Peter Paul

Registered User.
Local time
Today, 04:13
Joined
Jan 1, 2000
Messages
82
Pat and Andre,
thanks for your help. Unfortunately, I am still not having succcess.

I made the recordsource for the form a query which contained both the control table, and the lookup table.

I created a combo-box which had the control as the Description of the lookup table, which I need displayed.

When I did this, I found that I was not able to change the CODE field from what already existed, and the DESCRIPTION field did not display the proper code, nor could I change the DESCRIPTION field.

Any further assistance would be greatly appreciated, I kow that this can be done, just wish I were a tad smarter.

Thank you again,
Peter Paul
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 23:13
Joined
Feb 19, 2002
Messages
43,484
I just re-read your question. I didn't notice the first time that you switched from a question about reports to one about forms. The suggestion I posted is for the REPORT recordsource.

On the form you don't need the join. Just create a combobox with a recordsource that gets the description and bind it to the code field in the main table. If you let the wizard build the combobox, it's pretty easy to set up. The combobox will show the description but save the code to the table.
 

Users who are viewing this thread

Top Bottom