Using checkboxes to update data tables

A

andiam24

Hello,

I created a database for sample submission. On the form I would like to give
users the option to select various processes using checkboxes (i.e. TOC, LAL,
BCA, etc.) that will be performed on the sample set and have the selected
processes associated with the sample name on the table. Thanks.
 
A

andiam24

I have set up several tables-
Sample Table
-Sample ID
-Project ID
-# of Samples
-Assay
-Date Submitted

Assay Table
-Assay ID
-Assay

Project Table
-Project ID
-Project

I would like the information on the form to be stored in the respective
tables as it is entered. Assay ID and Project ID are related in a one-to-many
relationship to the Sample Table.
 
D

Duane Hookom

You seem to be making some assumptions that we know how "various processes
using checkboxes (i.e. TOC, LAL, BCA, etc." related to projects and assays.
The only thing linking your first and most recent post is "samples".

Give us some additional information if you want some assistance.
 
K

Ken Sheridan

What you have here is a many-to-many relationship type between samples and
processes, so firstly you need a table Processes with a primary key column
Process containing the values TOC, LAL etc in separate rows. The
many-to-many relationship type is modelled by another table, SampleProcesses
say, with two foreign key columns SampleID and Process referencing the
primary keys of the samples and processes tables.

For data entry the normal solution would be to include a SampleProcesses
subform within a Samples form, linked on SampleID. The subform would be in
continuous form view and contain one control, a combo box with a RowSource of:

SELECT Process FROM Processes ORDER BY Process;

Recording a process performed on a sample would then simply be a matter of
inserting a new row in the subform by selecting the relevant process in the
combo box.

It would be possible to do it with check boxes rather than a subform, but
these would be unbound and you'd need code in the form's module to assign
values to the checkboxes in the case of existing records, and to insert rows
into the SampleProcesses table in the case of new records. It can be done,
but a subform is far simpler and is also self-maintaining in that if a new
process is added to the list this is simply a question of inserting a row
into the Processes table. The combo box on the subform will automatically
reflect this, whereas with check boxes the form design would need amending.
It is possible in fact to add a new process directly via the combo box by
means of code in its NotInList event procedure, which we can help you with if
necessary.

Ken Sheridan
Stafford, England
 

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