Using multiple Options in Checkboxes to add records (1 Viewer)

Local time
Today, 17:19
Joined
Mar 23, 2022
Messages
45
Suppose my form looks like this

1648443147025.png

Can I add records into the event table using multiple options in checkboxes like below :
1648444056804.png

Or can I also use List Box to add records
 

bob fitz

AWF VIP
Local time
Today, 11:49
Joined
May 23, 2011
Messages
4,717
You could probably do either but Why would you?
It seems that you have a table of "athletes" and a table of "events".
Since each event can have many entrants and each athlete can be in many events, IMHO, what you need is a table to store the Pk from the athletes table and the Pk of the events table which would represent this many to many relationship correctly.
 
Local time
Today, 17:19
Joined
Mar 23, 2022
Messages
45
I don't want to use the datasheet view for entry of events for a particular athlete. I want to use checkboxes or list boxes for data entry of events of a particular athlete into the events table.
You could probably do either but Why would you?
It seems that you have a table of "athletes" and a table of "events".
Since each event can have many entrants and each athlete can be in many events, IMHO, what you need is a table to store the Pk from the athletes table and the Pk of the events table which would represent this many to many relationship correctly.I dont want to use
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:49
Joined
Sep 21, 2011
Messages
14,051
I don't want to use the datasheet view for entry of events for a particular athlete. I want to use checkboxes or list boxes for data entry of events of a particular athlete into the events table.
The problem with that approach is as you add new events , you need to amend the form each time? :(

Most people would use a process where the new event is just added as a new record. No form amendment required.
 
Local time
Today, 17:19
Joined
Mar 23, 2022
Messages
45
The problem with that approach is as you add new events , you need to amend the form each time? :(

Most people would use a process where the new event is just added as a new record. No form amendment required.
Yes, Thats true.
But I can use List Box with Multiple Selection Right. The events can be linked to the events type table. Can you help me with Multi Selection List Box.
 
Last edited:

MajP

You've got your good things, and you've got mine.
Local time
Today, 07:49
Joined
May 21, 2018
Messages
8,463
Your tables should use a junction table as @bob fitz points out. This demonstrates inserting, removing, and displaying reccords using the MultiSelect. It is done on a popup, but you could do it on the main form as well.

There is another example here doing it with a fake Multi value field control.

In either case you will need an insert query and a delete query. I tried to make this somewhat universal, but will likely take some code.
 

Attachments

  • SelectUnselect_MultiSelect.accdb
    1 MB · Views: 204

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:49
Joined
Feb 19, 2002
Messages
42,981
Your event table doesn't make sense. I would expect it to have a date and perhaps a finish place.
 

Users who are viewing this thread

Top Bottom