Using 2 forms to populate 1 table??? (1 Viewer)

sarahrose895

New member
Local time
Today, 11:33
Joined
Dec 23, 2016
Messages
2
:banghead::banghead::banghead::banghead:
Ok... so I have a very basic database that needs to record the details of each student (ID, name, course) and their module choices (4 modules in semester 1 and 4 modules in semester 2).
I have three forms: studentdetail, semester1options and semester2options.
I have two tables: students (ID, name, course) and modulechoices (ID, S1M1, S1M2, S1M3, S1M4, S2M1, S2M2, S2M3, S2M4).
I can get it to save the studentdetail data to the students table, write the corresponding ID to the semester1options and semester2options forms and save the ID and S1M1-S1M4 data (from the semester1options form) to the modulechoices table.
However, I can't get the S2M1-S2M4 data to save to the modulechoices table on the same row as the corresponding ID and semester 1 module choices.
Does anyone know how to get two forms to populate the same table? I've attached a snip of how it populates it at the moment, which is not what I want. I need all of the data shown in that screenshot to appear on the same row.

Thanks
 

Attachments

  • Capture.JPG
    Capture.JPG
    31.6 KB · Views: 103

plog

Banishment Pending
Local time
Today, 06:33
Joined
May 11, 2011
Messages
11,611
That's not how you should set up your tables. Data should be added vertically (with more rows) and not horizontally (with more columns). You need to simplify your tables. modulechoices should look like this:

modulechoices
mc_ID, mc_Semester, mc_Number, mc_Module
1, B323073, 1, 1, SBC010
2, B323073, 1, 2, SBC020
3, B323073, 1, 3, SBC030
4, B323073, 1, 4, SBC040
5, B323073, 2, 1, SBC050
...

That's how the table should look. Then as for forms, you simply make a subform on your Student table. It would allow you to add as many semester/modules as you need.
 

sarahrose895

New member
Local time
Today, 11:33
Joined
Dec 23, 2016
Messages
2
Hi, thanks for the reply. The database is actually for some programming coursework and I need to show that I can use buttons etc. to move onto new forms. It sounds silly but I'm not sure there are any marks for subforms so I'd prefer not to use them if possible. If I set up the table as you suggested, would I be able to populate the table with data as you suggested?
i.e.
1, B323073, 1, 1, SBC010
2, B323073, 1, 2, SBC020
3, B323073, 1, 3, SBC030
4, B323073, 1, 4, SBC040
5, B323073, 2, 1, SBC050
 

Users who are viewing this thread

Top Bottom