combining information

R

Rick

I have a table with Company Names and CompanyIDs fields. I
have another table that stores certain CompanyIDs with
VendorIDs. I want to have a form that will show a list of
Company Names and include a check box that will be checked
if the Company is in the second table. I could then check
an empty check box to add the CompanyID to the second
table.

I was going to populate a list box on current of the form,
but I can't think how to tie a check box in. If I use a
subform with an unbound checkbox, when I check it, it gets
checked for all records.

Any thoughts?

Rick
 
T

Tim Ferguson

I want to have a form that will show a list of
Company Names and include a check box that will be checked
if the Company is in the second table.

This is not tested, but it should be done with simple join and grouping
query:

SELECT Companies.CName,
(COUNT(Sales.VendorID) > 0) AS IsInSalesTable
FROM Companies RIGHT JOIN Sales
ON Companies.CompanyID = Sales.CompanyID
GROUP BY Compaines.CName

Hope that helps


Tim F
 
R

Rick

I can get the join to work but I'm having trouble figuring
out how to use a check box to: Indicate which companies
are in the vendor table and to tell it which vendoprs to
add to the vendos table????
Thanks.
Rick
 
T

Tim Ferguson

I can get the join to work but I'm having trouble figuring
out how to use a check box to: Indicate which companies
are in the vendor table

Put a check box on the form. You are using a form aren't you?
and to tell it which vendoprs to
add to the vendos table????

As long as you know what you want to put into the Vendors table, you can
catch the chkIsInVendorsTable_AfterUpdate event; see if it has changed from
No to Yes, and then write a record to the table using INSERT INTO Vendors.

If you need more specific help, you'll have to post back with a little more
detail on the tables.

B Wishes


Tim F
 

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