Populate form for data entry

terrytek

Registered User.
Local time
Today, 12:56
Joined
Aug 12, 2016
Messages
75
I have a form with two combo boxes that populates a subform based on the values in those combo boxes to show some data.

I need to do the same thing with another set of data, except I need the combo boxes to populate the subform, but then allow me to enter data for each record, and then write the whole record to a table. Here is an example:

Choose class, choose year in combo boxes on main form.

In subform, show the students enrolled in that class for that year.

Enter hours attended for each student, and date hours entered, and write class, year, student, hours, and date to a table.

How could I accomplish this?

Thank you!
terrytek
 
the subform must be biund to the table/query.
you should have all those field in the subform.
hide them by making their Visible property to No.
create a master/child link fields to thr subform based on the Year, date, hour and class.
when you do this, those field in the link will be automatically written to the table.
 
There is a sample database showing a solution to very similar requirement in post three of this thread.
 
There is a sample database showing a solution to very similar requirement in post three of this thread.

I looked at this and tried to determine how you had structured things, but I am not advanced enough with Access to figure out how to get where I need to be from there. Is there something you could refer me to to read to learn how to do that, or could you give me more instruction?

Thank you.
 
the subform must be biund to the table/query.
you should have all those field in the subform.
hide them by making their Visible property to No.
create a master/child link fields to thr subform based on the Year, date, hour and class.
when you do this, those field in the link will be automatically written to the table.

But how do I get a list of students in the class to show in the subform? The table bound to the subform is empty until data is entered into it.
 
Is there something you could refer me to to read to learn how to do that, or could you give me more instruction?

I have never seen anything published on that technique except what I posted.

But how do I get a list of students in the class to show in the subform? The table bound to the subform is empty until data is entered into it.

The crux of the technique employs a subform bound to a query with an outer join rather than a table. The students are displayed even though there are no records in the StudentGrades table because they are on the "all records" side of the join.

Entering a value anywhere in the subform initiates a record that will ultimately appear in the SutdentGrades table.
 
I have never seen anything published on that technique except what I posted.



The crux of the technique employs a subform bound to a query with an outer join rather than a table. The students are displayed even though there are no records in the StudentGrades table because they are on the "all records" side of the join.

Entering a value anywhere in the subform initiates a record that will ultimately appear in the SutdentGrades table.

Thank you so much for your help. The outer join was the key to my getting it. I had to play around with the underlying query to get it updateable but was finally able to do so. Much appreciated!
 
I had to play around with the underlying query to get it updateable but was finally able to do so.

Yes. The key fields for the StudentGrades table must be included in the query for it to be updateable.

Although it is the same value, the StudentID from the student table won't do it.
 
the subform must be biund to the table/query.
you should have all those field in the subform.
hide them by making their Visible property to No.
create a master/child link fields to thr subform based on the Year, date, hour and class.

There is no need to put hidden controls (they are not "fields") on a subform. The LinkChildFields refer to fields in the recordset and doesn't care about the controls.
 

Users who are viewing this thread

Back
Top Bottom