I have a function (below) that syncs 2 forms together and closes out the original form. Goto_Form is the form that you are going too. Old_Form is the form you are currenly in, and frm is the form you are in. I was wondering if there was a way of compacting the Old_Form and frm because they are the same form. The function is called like the follow:
Sync_Forms "Main", "Sales", Me
-----------------------------------
Public Sub Sync_Forms(Goto_Form As String, Old_Form As String, frm As Form)
Dim f As Form
Dim rs As Recordset
Dim stDocName, stLinkCriteria As String
DoCmd.OpenForm Goto_Form
Set f = Forms(Goto_Form)
Set rs = f.RecordsetClone
stLinkCriteria = "[ACT]=" & frm![ACT]
rs.FindFirst stLinkCriteria
f.Bookmark = rs.Bookmark
DoCmd.Close acForm, Old_Form
End Sub
Sync_Forms "Main", "Sales", Me
-----------------------------------
Public Sub Sync_Forms(Goto_Form As String, Old_Form As String, frm As Form)
Dim f As Form
Dim rs As Recordset
Dim stDocName, stLinkCriteria As String
DoCmd.OpenForm Goto_Form
Set f = Forms(Goto_Form)
Set rs = f.RecordsetClone
stLinkCriteria = "[ACT]=" & frm![ACT]
rs.FindFirst stLinkCriteria
f.Bookmark = rs.Bookmark
DoCmd.Close acForm, Old_Form
End Sub