Access 2007 checkboxes to be added to Form based on a query - TechRepublic
Question
January 16, 2009 at 04:46 AM
pstanger

Access 2007 checkboxes to be added to Form based on a query

by pstanger . Updated 17 years, 5 months ago

Hi All,

Before I start I’ll explain the basic Table structure.
Table:Contacts (basic contact information)
Table:Interests (contains a list of interests)
Table:ContactInterests (joining table for the other two)

Table Relationships
Contacts.ID (1 to many) ContactInterests.ContactID
Interests.ID (1 to many) ContactInterests.ContactID

I have a contacts Form that displays the information in an editable format, in this there is a subform that based on the Contact.ID being viewed presents a combobox to allow the interests to be changed/added and a further subform showing the interests currently associated with that Contact.

I think that this is very confusing set up for end-users. What I would like to do is create the subform in the Contacts Form based on the contents of the Table Interests.
Ideally I would present a Checkbox for each item in Table Interests which is already checked if contained in ContactInterests.

However I am having difficulty in coding this in VBA linked to Microsoft Access 2007.
1. What code is used to create a Checkbox on the Form?
2. How do a loop through a table/query adding a checkbox for each result?

This discussion is locked

All Comments