G
Guest
I have a Household form that has a continuous subform for all the People that
reside in that household. The continuous subform has a command button that
opens a "child"form where the user can add additional details for that person
(add to their history, etc.)
This works well except when a new person is added to continuous subform,
when the command button is selected, the data added to the continuous subform
has not been added to the database, and is not available for the child form.
This can be avoided by clicking on a different record in the subform prior to
opening the child form, but for ease of use, is there some code I could add
to the command button that would save the current record so that the child
form opens properly?
Code on the command button:
Private Sub Command_Details_Click()
On Error GoTo Err_Command_Details_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "People"
stLinkCriteria = "[People.People ID]=" & Me![People ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command_Details_Click:
Exit Sub
Err_Command_Details_Click:
MsgBox Err.Description
Resume Exit_Command_Details_Click
End Sub
reside in that household. The continuous subform has a command button that
opens a "child"form where the user can add additional details for that person
(add to their history, etc.)
This works well except when a new person is added to continuous subform,
when the command button is selected, the data added to the continuous subform
has not been added to the database, and is not available for the child form.
This can be avoided by clicking on a different record in the subform prior to
opening the child form, but for ease of use, is there some code I could add
to the command button that would save the current record so that the child
form opens properly?
Code on the command button:
Private Sub Command_Details_Click()
On Error GoTo Err_Command_Details_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "People"
stLinkCriteria = "[People.People ID]=" & Me![People ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command_Details_Click:
Exit Sub
Err_Command_Details_Click:
MsgBox Err.Description
Resume Exit_Command_Details_Click
End Sub