473,396 Members | 1,836 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Showing first and second columns of a lookup table

Hi there

I am a novice access user using Access 2003 in a Windows XP Home platform.

I have a table containing 2 colums, the first containing a code (CODE) and the second containing the description (DESCRIPTION) of the code.

the first table thus looks like this

CODE DESCRIPTION
001 infection
002 cancer
003 injury

I use the information contained in this table to catergorise variables in a second table.

Within the second table I have the column with the rows of data that I wish to recatergorise (DATA), a second colum with the code which looks up data from the CODE column of the first table, and a third column in which I would like to have the decription of that code (DESCRIPTION) displayed for that particular code.

Thus I would like the second table to look like this:
DATA CODE DESCRIPTION
tonsillilitis 001 infection
pneumonia 001 infection
lung cancer 002 cancer
Head injury 003 injury
skin cancer 002 cancer

I have managed to do a lookup for the CODE column successfully using a combo box of the lookup of the code field in the second table. I would like the description of that code to be automatically displayed on the second table as I am editing it. I have tried setting the column count and bound column as 2 under the lookup of the code query, but this has not helped.

The only display that I get looks like this:

DATA CODE DESCRIPTION
tonsillilitis 001
pneumonia 001
lung cancer 002
Head injury 003
skin cancer 002


I hope that somone can help me figure this problem out.

With Peace
Mar 20 '07 #1
8 3182
I am not sure if my last post made sense, so I if I need to rephrase the question, please let me know.
Mar 20 '07 #2
Rabbit
12,516 Expert Mod 8TB
Bound column is what is stored. What you're looking for is column widths. So if you have 3 columns and only want to see the third column, you would use 0;0;. This will hide the first 2 columns.
Mar 20 '07 #3
Thank you so much for responding

Your suggestion has helped me somewhat, however it has not completely resolved the issue. Using the colum widths, I set it to 1,3 since I wanted to see both the code and the description in the combo box. This helps me to see the description of the code only when I click on the drop down menu.

I would like to be able to see description of the code alongside the code in a separate uneditable column, next to the code. I have tried to creat a new column in the second table called description of code, and have used the sql statement builder to link in the data from the first table. What this does hoewever is create a seperate dropdown menu in the description column that is unrelated to the code in the column next to it.

I am needing to type in the code and have the corresponding description automatically place in the colum next to it that is visable without having to click on the dropdown menu.

Ishaaq
Mar 20 '07 #4
Rabbit
12,516 Expert Mod 8TB
Use a listbox rather than a combobox.
Mar 20 '07 #5
I have tried that but it still does not work.

Just to restate what needs to be done. Table 1 has the numerical code and the description. Table 2 sources from table 1. In table 2, I enter in the numerical code. The list box displays both the numerical code and description now, however once the data is entered, only the numerical code is left in the field. I want both the numerical code and description to be displayed, either in the same column or a different column. The description must correspond its numeric code but must not be editable. The description must come up automatically when the numeric code is entered on the screen and continue to be displayed afterwards when I move to another field. The description must ideally be in a seperate column to the numerical code but must correspond to its numerical code as what it is in table 1.

I hope this is clearer. Would you like me to send a screen shot of what I am doing?
Thanks
Mar 20 '07 #6
Rabbit
12,516 Expert Mod 8TB
So you want to store both columns of data? The listbox should let you view multiple columns of data. There's no way to do this at the table design level. You can do it from a query or a form.
Mar 20 '07 #7
Thanks

Building query has given me exactly what I needed.

Your help was greatly appreciated.
Mar 21 '07 #8
Rabbit
12,516 Expert Mod 8TB
Not a problem, good luck.
Mar 21 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Carl | last post by:
Hi, I have found a way to map attributes (columns) to column headings. But this runs really slow. Is there a way to improve it? Thanks, Carl <?xml version="1.0" encoding="utf-8" ?>...
2
by: c.anandkumar | last post by:
Hi All - I have some problems getting a small piece of javascript working correctly for Firefox. Here is what I am trying to do - 1. I have a form (like a search form) 2. I have many groups...
1
by: Swadh | last post by:
Hi, I need urgent help on Windows Form datagrid. I have to Display a datagrid that has a textbox column and another one combo box column. I have two tables in my Access database as: Table 1:...
30
by: Andante.in.Blue | last post by:
I just browsed through some of my Access links when I came across the Ten Commandments of Access (http://www.mvps.org/access/tencommandments.htm). Some of the points I heartily agree with (and...
2
by: Tor Inge Rislaa | last post by:
Showing an HTML file in part of a Webform Hi I have a Webform with some buttons on the left side of the form. What I want when clicking one of the buttons is to show an HTML document in a part...
1
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems...
6
by: Sebastian Santacroce | last post by:
How do I get a datetime field from a database to show just time in the datagrid. The default just shows date. Thank you Sebastian
10
by: Jimmy | last post by:
The description field looks up values from another table: Description, ProductCost, DeliverCost, OtherCost & SalePrice. AfterUpdate of the description field is: Me!Cost =...
4
by: Sep410 | last post by:
Hi All, I have problem with combo box. It is funny but I don't know what to do. When I load my form I load my combos with this Sub: Private Sub CityLoad() Dim sql As String ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.