Checkboxes and unique records.

dmanonice

New member
Local time
Today, 18:55
Joined
Mar 4, 2024
Messages
1
Hello everyone,

I have created a form that has basic tombstone information and within this tombstone the fields that will be applicable here are "Origin" and "Product"

On the form the next section down is "destination" and all of the destinations I service are listed and have a check box beside them.

What I would like to do is, check off the applicable destinations & when I click on a "create" button, that it creates a new record, with the same origin and product, but each record has 1 unique destination.

So for example if I set the Origin to Ottawa and check off Vancouver Edmonton and Calgary, there would be 3 records created and populated with the rest of the information on the form. (regrettably a lot of the information is duplicated, but I cannot group the destinations or other information together for operational reasons on reports).

Is this possible, is access even the right program for this?
 
on the form ( fMyForm), a combo box holds ORIGIN items.
also a subform that holds the list of all Products
the list has the PRODUCT field and CHOSEN check box

user selects the origin & checks all Products wanted.
then clicks a CREATE button
this runs an append query i.e:

INSERT INTO tTargetTbl ( Origin, Product)
SELECT [forms]![fMyForm]![cboOrigin] AS origin, tProducts.Product
FROM tProducts
WHERE ((tProducts.Chosen)=true)
 
Hello everyone,

I have created a form that has basic tombstone information and within this tombstone the fields that will be applicable here are "Origin" and "Product"

On the form the next section down is "destination" and all of the destinations I service are listed and have a check box beside them.

What I would like to do is, check off the applicable destinations & when I click on a "create" button, that it creates a new record, with the same origin and product, but each record has 1 unique destination.

So for example if I set the Origin to Ottawa and check off Vancouver Edmonton and Calgary, there would be 3 records created and populated with the rest of the information on the form. (regrettably a lot of the information is duplicated, but I cannot group the destinations or other information together for operational reasons on reports).

Is this possible, is access even the right program for this?
Hi
Can you upload a screenshot of the Relationship Window?
 
Hi. Welcome to AWF!

Do you know if your table structure is properly normalized?
 
Rather than writing code to do this, use a form or subform with a combo box to select the destination. No code is required - unless you use the good practice of actually using the BeforeUpdate event to validate a record before it gets saved.
 
So for example if I set the Origin to Ottawa and check off Vancouver Edmonton and Calgary, there would be 3 records created and populated with the rest of the information on the form
isn't it the reverse, you are creating records for Unchecked destination, when you should be Checking them All first (so that it will be clear to Other users) to be able to add All 3 destinations?

then, why not have all the destination have check mark first on New record?
 

Users who are viewing this thread

Back
Top Bottom