Checkboxes and unique records. (1 Viewer)

dmanonice

New member
Local time
Today, 07:21
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?
 

Ranman256

Well-known member
Local time
Today, 07:21
Joined
Apr 9, 2015
Messages
4,337
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)
 

mike60smart

Registered User.
Local time
Today, 12:21
Joined
Aug 6, 2017
Messages
1,905
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?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:21
Joined
Oct 29, 2018
Messages
21,473
Hi. Welcome to AWF!

Do you know if your table structure is properly normalized?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:21
Joined
Feb 19, 2002
Messages
43,275
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.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:21
Joined
May 7, 2009
Messages
19,244
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

Top Bottom