Query

L

Leo

Hi -

I am trying to create a table using a query that does the
following:

- Pull a 'template' list of items for Part A from a
table 'tbl_Template' and put it in a new table. This list
will always have the same line items and will populate the
1st column of the new table.
- Pull a list of items that exists for Part A from another
table 'tbl_line_items'. This list may change based on what
items exists under part A. However, all items that exist
in this table are already defined in the template table.

What I want to do with this is to create a 'checklist'
that shows all items possible in the 1st column and the
following columns will be 'checked-off' according to items
that appear in tbl_line_items.

I hope my description is clear. It is a pretty straight-
forward question.

Please advise.

Thanks!
 
L

Les

Leo,

Try doing the following:
1) Make a new table with 2 columns, one for part and one
that is the checkbox. Making the table beforehand allows
you to specify checkbox as data type yes/no.

2) create an append query - using sql something like this -
INSERT INTO Newtbl ( part, checkbox )
SELECT tbl_Template.part, IIf(IsNull([tbl_line_items]!
[part]),0,1) AS Expr1
FROM tbl_Template LEFT JOIN tbl_line_items ON
tbl_Template.part = tbl_line_items.part;

You will end up with all parts from tbl_Template and a
checkbox checked off if the part was in tbl_line_items.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top