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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display value of id in table column

Status
Not open for further replies.

pathetic

Programmer
Dec 3, 2004
74
US
I have a table which the data is uploaded from a web form.
The table contains a column titled Category ID and ID's 1-20 are being uploaded from web form to this access database table column. Also in this table I presetnly have an empty column titled Category Value. How do I get the Value of the Category ID autopopulated into the Category Value column?

Category ID and Category Value are contained in a table named tblCategories

I suspect this is a simple procedure, but I know nothing about Access... I inherited this project and just giving it my best shot. Your help greatly appreciated!

 
Hmmmm ...

You want two different columns in the table to contain identical values? Why would you want redundant information in your table?

You can do it with an UPDATE query
Code:
UPDATE tblCategories SET [Category Value] = [Category ID]
You should look at your requirements to determine if this duplication is really necessary.
 
The column labeled Category ID contains the id numbers uploaded from the form field from web site, column titled Category Value is intended to display the name of the category (Value) of the ID that is uploaded.

CategoryID = 1 then Category Value = Apple
CategoryID = 2 then Category Value = Orange

The form field on the web form is a dependent drop down select that is rather complicated as is, otherwise would have built the logic in there. It seems to me that Access should have some method of enabling "If CatID = 1" then "Category Value=Apple" ...

Thank you for your reply.


 
PS: I will attempt an Update Query and also was suggested I try an Append Query.

I appreciate your help.

Thank you
 
Do you have another table somewhere that has the relationship between CategoryID and CategoryValue? If so then you can create a query of the form
Code:
Select A.CategoryID, B.CategoryValue

From tblCategories As A INNER JOIN tblCategoryValues As B
     ON A.CategoryID = B.CategoryID
It's really not necessary to copy the value of "CategoryValue" into the same table as you are using to store the CategoryIDs from the Web.
 
It's really not necessary to copy the value of "CategoryValue" into the same table as you are using to store the CategoryIDs from the Web."

Yes it is, because next step in this application is to generate CFGrid (coldfusion) and I need the values to display on the grid, not the ID's

thanks for the tips.
 
Wait a minute, I see the confusion I've caused.

There ARE TWO tables...
1) tblPending (this is where to ID and other data is uploaded to and where I need to present the Value of the ID)
2) tblCategories (this contains ID/Value combination for the web form to make sense and to be able to create dependency in my SELECT dropdown form fields)

I see where you may have suspected redundancy since I did not specify the name of the second table and was assumable that I was uploading to same table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top