Dan Bonser
Dan Bonser

Reputation: 3

Access: Using table data in one column as field names in another table

Okay, I have one table that is a list of items. I want that list of items as field names for another table. I want to be able to add to the list, easily, which will, in turn, add new field names/columns to this other table. Example:

Table 1

ID | Name

1 | Bob

2 | Paul

3 | John

Table 2

ID | Bob | Paul | John

1 | y | n | y

Upvotes: 0

Views: 635

Answers (1)

Minty
Minty

Reputation: 1626

You shouldn't store the data like the second table. It isn't normalised and will lead to a whole world of pain further on. You should store that data something like;

ID | PersonID | Value 1 1 y 2 2 n

This will be easier to query and won't require a re-design when Harry arrives.

You can create a crosstab query to display it like your example.

Upvotes: 1

Related Questions