G
Guest
I have a form with nested subforms and I'm trying to add a new record with
all the information from the previous forms. I'm only getting the field
information that triggers the nested subforms. So the forms go like this:
Main form - off employee table
Subform1 - links names and gets programs
Subform2 - gets classes from the programs
Subform3 - gets specific class information
Here's the code:
Form_frmTraining subform - 1
Option Compare Database
Private Sub Form_AfterUpdate ( )
Dim db As Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset ("tblTraining", dbOpenDynaset)
With rs
.AddNew
![Training Date] = [Training Date]
![Program] = [Program]
![Class] = [Class]
![SSN] = [SSN/ID]
.Update
.Bookmark = .LastModified
End With
rs.Close
Set rs = NOthing
End Sub
So Training Date comes from the last subform that has the focus (Subform3),
Class comes from Subform2 and Program comes from Subform1. I'm not getting
the SSN which comes from the Main form. What's wrong?
Thanks.
Teresa
all the information from the previous forms. I'm only getting the field
information that triggers the nested subforms. So the forms go like this:
Main form - off employee table
Subform1 - links names and gets programs
Subform2 - gets classes from the programs
Subform3 - gets specific class information
Here's the code:
Form_frmTraining subform - 1
Option Compare Database
Private Sub Form_AfterUpdate ( )
Dim db As Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset ("tblTraining", dbOpenDynaset)
With rs
.AddNew
![Training Date] = [Training Date]
![Program] = [Program]
![Class] = [Class]
![SSN] = [SSN/ID]
.Update
.Bookmark = .LastModified
End With
rs.Close
Set rs = NOthing
End Sub
So Training Date comes from the last subform that has the focus (Subform3),
Class comes from Subform2 and Program comes from Subform1. I'm not getting
the SSN which comes from the Main form. What's wrong?
Thanks.
Teresa