Thursday, April 16, 2009

Microsoft Access: How to Insert a Subdatasheet

I had two tables in my Access database, like category and subcategory such that the categoryId was being used as foriegn key in the subcategory table, however when I was opening the category table datasheet view it was not show a + sign to collapse and browse the subcategories. I remembered seeing this kind of view earlier and I remember that it happen when you make the relationships between the tables, so I went ahead and did that but it was now show that '+' sign in the datasheet view. I tried to find the older tables in which it was showing the '+' sign and found out that the type of relationship in them was "one-to-many" while some how in my case it was "intermediate", recreating the relationship automatically made it "one-to-many" and the problem solved.

During this investigation I also found that this can be done without actually setting up relationships. This is by going to insert menu selecting Subdatasheet and then selecting whatever table or query you want as subdatasheet and which column will actually link the tables.

0 comments:

Post a Comment