By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 663 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

Multiple check boxes to create new records in Associative Table

P: n/a
Hi,

I am working on a ms access database and I am having trouble using a
form to create new records in an associative table.

Here is the breakdown of my database:

Main Table - Computer
Primary Key - ComputerID (AutoNumber)
ComputerName
etc.

Associative (relational Table) - Computer_Application
Primary Key - ComputerID
Primary Key - ApplicationID

3rd Table - Application
Primary Key - ApplicationID
ApplicationName
etc.

Each computer can have many different applications on it and each
application can be on many computers. I am trying to create a form with
multiple checkboxes to select multiple applications and record each
application in the Associative table - Computer_Application.

This form is a subform of a Computer form, where Computer_ID is carried
through using open_args.

What I need help doing is when I check a box on the form, there is a
new record created in the Computer_Application table with the
ComputerID and ApplicationID. This will also allow for multiple
checkboxes to be checked and multiple records being created at the same
time when a save button is clicked.

If you need more information please let me know. Any help would be
great. I have been trying to research this a little bit and have been
coming up a little short each time. I keep getting stuck at the coding
aspect (looping through checkboxes).

Please let me know if you can help.

Thanks a lot.

Jake Lonc

Aug 14 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Why not create a combobox in your subform (based on
Computer_Application), and then just make the rowsource of the Combobox

SELECT ApplicationID, ApplicationName
FROM Application
ORDER BY ApplicationName;

Then set the LimitToList property to True.

I would recommend doing it this way for the following reasons:
1. it's bad UI design to have to change the UI constantly (if you add
new software to your table, which happens all the time).
2. it's MUCH easier to change data in your underlying tables, and can
change it without touching your UI.

Draw an analogy between your app and Northwind.

Application ~ Product
Computer_Application ~ Invoice Line Items
Computer ~ Invoice

I just think comboboxes are much easier to work with in this case. I
only use checkboxes for real Yes/No fields.

Aug 14 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.