Add records based of the days and date range entered. (1 Viewer)

tamraght

New member
Local time
Today, 11:49
Joined
Jun 14, 2021
Messages
9
Hello friends,

I have a form where I choose the class code, the days of the week when the class will be scheduled, and the date range when this class will start and end. So, that the program will add all the class schedule, each record will have the class code, and the class date.

Here is a screenshot of the program.

Sans titre1.png


Could anyone tell be how the VBA code or the query would look like?

and lastly, I want to thank everyone who supports and participates in this forum. I feel lucky to finally find a place where I can get the support I need.

Thank you,
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:49
Joined
Oct 29, 2018
Messages
21,467
Can you show us the structure of the table where you want to add these new records?
 

tamraght

New member
Local time
Today, 11:49
Joined
Jun 14, 2021
Messages
9
Can you show us the structure of the table where you want to add these new records?

Here is a screenshot of the table where the records will be added to.



Sans titrehh.png
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:49
Joined
Oct 29, 2018
Messages
21,467
Thanks. What is the last column for?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:49
Joined
Oct 29, 2018
Messages
21,467
That is for cancelation in case a class is canceled. We modify it manually.
Okay, so I am thinking you don't need that table at all. If you must, you can have a table of cancelled classes instead.

What would you use this table for?
 

tamraght

New member
Local time
Today, 11:49
Joined
Jun 14, 2021
Messages
9
Okay, so I am thinking you don't need that table at all. If you must, you can have a table of cancelled classes instead.

What would you use this table for?
To add class dates. So whenever I will be adding attendance data to the database, I will choose the class code (ID_GROUPE), so I will be given the dates that this class have in its schedule.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:49
Joined
Oct 29, 2018
Messages
21,467
To add class dates. So whenever I will be adding attendance data to the database, I will choose the class code (ID_GROUPE), so I will be given the dates that this class have in its schedule.
For attendance recording, you don't need all that information. That table structure is not normalized. I don't even see a column to record which student attended or how many students were present.

It might help if you can review the table structure or data model for a class and students database. Somebody here might have a link where you could find a sample or a template. I'll see if I can find any.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:49
Joined
Oct 29, 2018
Messages
21,467
Here's one potential example.

 

tamraght

New member
Local time
Today, 11:49
Joined
Jun 14, 2021
Messages
9
Thank you for all the information you provided. I will diffinitely look at it and try to rearrange my database.

At this moment, I just need a code or SQL, so I can use it to add mutliple records, each one will have the Class code I choose, a date that comes in those days of the week and is between the date range we chose.

Thank you so much all.
 

Users who are viewing this thread

Top Bottom