Print Page | Close Window

Automatically add field data

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=16059
Printed Date: 29 March 2026 at 7:40pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Automatically add field data
Posted By: AlexDP
Subject: Automatically add field data
Date Posted: 02 August 2005 at 3:14pm

I'm using MS Access 2000.
I want to be able to put in a piece of text in one field of a table and the database automatically add another field.

For example, enter a supplier and the database adds the catagory.
So we could have 20 suppliers but only 5 catagories. How do I do this?
I can create another table with each supplier matching a catagory.


Supplier1   Cat1
Supplier 2  Cat 1
Supplier 3  Cat 2
etc., etc.,

Thanks for your help. Hope you understood what I am asking! (If this is not possible in Access then I could use Excel.)



-------------
http://www.pimms-pages.co.uk - Guinea Pigs World
http://www.pimms-pages.co.uk/forums/ - Guinea Pig Forums



Replies:
Posted By: dj air
Date Posted: 02 August 2005 at 3:27pm
yim not 100% sure what you want to do.

you want 2 tables category and suppplier.

you need ot add a insert INTO suppliers table and set the category field to the same value as the field within the category table,.

how is it determined what category it goes into?


Posted By: AlexDP
Date Posted: 02 August 2005 at 3:38pm
I really want just one table that will contain a variety of information.

When I enter the supplier's name I want the catagory (say the type of goods supplied/department) to be automatically added.

Somewhere I would have to pre-define each supplier and the catagory to go with it. Each catagory would have several suppliers.



-------------
http://www.pimms-pages.co.uk - Guinea Pigs World
http://www.pimms-pages.co.uk/forums/ - Guinea Pig Forums


Posted By: dfrancis
Date Posted: 02 August 2005 at 4:58pm
Originally posted by AlexDP AlexDP wrote:

I really want just one table that will contain a variety of information.

When I enter the supplier's name I want the category (say the type of goods supplied/department) to be automatically added.

Somewhere I would have to pre-define each supplier and the catagory to go with it. Each catagory would have several suppliers.

 
I think that would be your second table. Or at least a text array that you could reference when inserting.
 
Just from the info... I would say two tables.
 
tbl_Supplier_Contact
Name | Address | Phone | etc
 
tbl_Supplier_Categories
Category_Name | Category_Info |
 
If the supplier can belong to more than one category, then it gets interesting in that you have to allow multiple selections. I'm thinking a category column in the contact table would be all you need.
 
(Just thinking out loud.)
 
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net