N
Nick hfrupn
I have a button on the main form that duplicates a selected record in a
sub-form. The sub-form is in datasheet view.
What I need to do is refresh the sub-form so that the selected record
remains selected. This is so that if I require another copy of the same
record, all I need to do is press the duplicate button again to get the third
record. I have tried to do a requery, below, of the sub-form but it always
reverts to the first record of the sub-form being selected
How can I fix this? Any help would be appreciated.
Regards
Nick
Private Sub cmdDuplicate_Click()
On Error GoTo Err_cmdDuplicate_Click
Dim stDocName As String
stDocName = "Qry Daily Summary-Apend Continuations"
DoCmd.OpenQuery stDocName, acNormal, acEdit
[Forms]![Daily Summary]![Child3].Requery
Exit_cmdDuplicate_Click:
Exit Sub
Err_cmdDuplicate_Click:
MsgBox Err.Description
Resume Exit_cmdDuplicate_Click
End Sub
sub-form. The sub-form is in datasheet view.
What I need to do is refresh the sub-form so that the selected record
remains selected. This is so that if I require another copy of the same
record, all I need to do is press the duplicate button again to get the third
record. I have tried to do a requery, below, of the sub-form but it always
reverts to the first record of the sub-form being selected
How can I fix this? Any help would be appreciated.
Regards
Nick
Private Sub cmdDuplicate_Click()
On Error GoTo Err_cmdDuplicate_Click
Dim stDocName As String
stDocName = "Qry Daily Summary-Apend Continuations"
DoCmd.OpenQuery stDocName, acNormal, acEdit
[Forms]![Daily Summary]![Child3].Requery
Exit_cmdDuplicate_Click:
Exit Sub
Err_cmdDuplicate_Click:
MsgBox Err.Description
Resume Exit_cmdDuplicate_Click
End Sub