Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating table cells from another table

Status
Not open for further replies.

AmieC

Technical User
Mar 6, 2008
2
US
Hi, I have a table that has two columns, TypeID which is a number and TypeName which is text. I want the TypeName column to automatically populate based on the number entered into the TypeID column. For example, in TypeID there are numbers 1, 2, 3. I want the TypeName column to look at the numbers and if it is 1, to always enter Tool, if it is 2, always enter Sample, and if it is 3, always Historics. I am a very new user and I am praying that this doesn't need code. If anyone can help me, it would be greatly appreciated. Thanks in advance!
 
You said you were new to Access, but surely you can see your question doesn't make sense. If you're creating a table and in the first column you type a 1, how can Access read your mind and put Tool in the second column?? When you create a table, you input the data. Now this sounds like a table that is used for descriptions. There will be no other table that has the descriptions in them. You do not have redundant data in a relational database. Now to display the info on a form, when the user types, or better, selects from a dropdown a TypeID, then you can use the Dlookup function, through code, to find the TypeName.
Since you're new to Access, my suggestion is to take courses in Access and buy many books. The concepts in Access are not intuitive and cannot be learn by oneself. For example Normalization. You MUST normalize your tables first before entering any data. See:
Fundamentals of Relational Database Design
As for coding, you won't be able to escape it. You will have to learn how to code.
 
Thank you for responding. I don't want the table to read my mind, and I do have another table that has the values 1 = tool, 2 = sample, etc. and on the form, the user uses a combobox to enter in the type, tool, sample, but because of the code used to change a second combo box based on the users' input into the first, the number value not the name of the type is stored in the second table. So, i just want some way to have the name visible in the second table as well, but maybe thats not important. Furthermore, I realize i need to learn code and hopefully will soon, but i am in the situation of having to complete this project by myself and quickly, so its not really possible at the moment.
 
So, you want a combo box that displays the name, but stores the number? you need to look into the "bound" column of the combo box....

Leslie

In an open world there's no need for windows and gates
 
Simply follow the combobox wizard when in form design view.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top