Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function Variables

Status
Not open for further replies.

Jengo

Programmer
Apr 17, 2000
100
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top