If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
VendorID and Category ID would be foreign keys, not primary keys, in the
junction table. In other words, they are fields of the same data type as their primary key namesakes in the Vendor and Category tables. If VendorID in the Vendors table has autonumber as its data type, VendorID in the junction table would be Number. In all other cases the data type needs to be the same in the two tables. You set the primary key in table design view, but not the foreign key. A field becomes a foreign key by its relationship to the primary key in another table. "Jessica" wrote in message ... Doug - Thanks for the help. I have made a new table called Junction table and made both the vendor ID and the Category ID primary keys. I have also created a Query and dragged all the appropriate fields into it. Where do I enter my info into? The vendor table and category tables? Or the Junction Table?? "Douglas J Steele" wrote: If you've got a one-to-many between vendor and categories, that means that a category can only apply to one vendor. Is that what you want, or do you want a many-to-many between vendor and categories (one vendor can have multiple categories, and a category can apply to multiple vendors)? For a true one-to-many, you'd need to add the Vendor Id as a foreign key in the Categories table. For a many-to-many, you need to introduce a new table that consists of the Vendor Id and the Category Id, and then populate it appropriately. In either case, you'll need to create a query that joins the 2 (or 3) tables together. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Jesica" wrote in message ... I have a DB that has two tables: (1) vendors (2) categories (I have made the category field mult-select) I have a relationship of one (vendor) to many (categories). How do I get the two tables to "combine" and show me a vendor that may have multiple categories? |
#12
|
|||
|
|||
Okay, I think I have everything working....almost. When I go back to my
vendor input form (I have a subform that has multi-select categories). When I chose a category or many categories, I get a message that says "You cannot add or change a record because a related record is required in table 'categories'. "Jesica" wrote: I have a DB that has two tables: (1) vendors (2) categories (I have made the category field mult-select) I have a relationship of one (vendor) to many (categories). How do I get the two tables to "combine" and show me a vendor that may have multiple categories? |
#13
|
|||
|
|||
If I posted this twice I apologize:
I think I'm almost "there" with the database. The only remaining problems is when I am in my vendor form (which has a categories subform) and I select a category, I get the following message: You cannot add or change a record because a related record is required in table 'categories' Please help! "Jesica" wrote: I have a DB that has two tables: (1) vendors (2) categories (I have made the category field mult-select) I have a relationship of one (vendor) to many (categories). How do I get the two tables to "combine" and show me a vendor that may have multiple categories? |
#14
|
|||
|
|||
The only things that comes to mind is that however you're getting the list
of categories on your subform isn't by querying the table, or that you're using a combobox on your subform, and you've bound the wrong column. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Jessica" wrote in message ... If I posted this twice I apologize: I think I'm almost "there" with the database. The only remaining problems is when I am in my vendor form (which has a categories subform) and I select a category, I get the following message: You cannot add or change a record because a related record is required in table 'categories' Please help! "Jesica" wrote: I have a DB that has two tables: (1) vendors (2) categories (I have made the category field mult-select) I have a relationship of one (vendor) to many (categories). How do I get the two tables to "combine" and show me a vendor that may have multiple categories? |
#15
|
|||
|
|||
How to I get my Access DB to list multiple vendors?
Jessica,
Did you ever get the error message "you cannot add or change a record because a related record is required in the table 'categories'" fixed. I'm having the same error message and I'm not sure how to fix it. Any help would be greatful. -- Lori "Jessica" wrote: If I posted this twice I apologize: I think I'm almost "there" with the database. The only remaining problems is when I am in my vendor form (which has a categories subform) and I select a category, I get the following message: You cannot add or change a record because a related record is required in table 'categories' Please help! "Jesica" wrote: I have a DB that has two tables: (1) vendors (2) categories (I have made the category field mult-select) I have a relationship of one (vendor) to many (categories). How do I get the two tables to "combine" and show me a vendor that may have multiple categories? |
#16
|
|||
|
|||
How to I get my Access DB to list multiple vendors?
Please post the table structure for both tables.
What field are you using for Master/Child links for form Vendors and subform Categories? "Lori Prewitt" Lobop@(no spam)fewpb.net wrote in message ... Jessica, Did you ever get the error message "you cannot add or change a record because a related record is required in the table 'categories'" fixed. I'm having the same error message and I'm not sure how to fix it. Any help would be greatful. -- Lori "Jessica" wrote: If I posted this twice I apologize: I think I'm almost "there" with the database. The only remaining problems is when I am in my vendor form (which has a categories subform) and I select a category, I get the following message: You cannot add or change a record because a related record is required in table 'categories' Please help! "Jesica" wrote: I have a DB that has two tables: (1) vendors (2) categories (I have made the category field mult-select) I have a relationship of one (vendor) to many (categories). How do I get the two tables to "combine" and show me a vendor that may have multiple categories? |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
2002 vs 2003 | Patrick Stubbin | General Discussion | 2 | May 17th, 2005 07:27 AM |
ACCESS LIST BOX SCROLL LOCK | Reason | Using Forms | 4 | April 2nd, 2005 04:19 AM |
How do I link a list to the previous list answer in an Access For. | Winkleby | Using Forms | 1 | January 13th, 2005 06:08 AM |
Union Query Not Returning A Value | Jeff G | Running & Setting Up Queries | 2 | October 19th, 2004 05:47 PM |
Multiple List function | George | Worksheet Functions | 8 | February 15th, 2004 10:13 AM |