From: orographicfish via AccessMonster.com on
Hello, hoping for a little help on this one: I have a subform called 'Company
Info' in the main form. I want users to be able to click a button to open a
split form called 'Add Companies'. My current code opens to the appropriate
record, but filters the records. Any help on the proper way to open to the
current record from the 'Company Info' subform to the related record on the
'Add Companies' split form without filtering any records would be greatly
appreciated.

Private Sub EditCompanyInfo_Click()
On Error GoTo Err_EditCompanyInfo_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Add Companies"

stLinkCriteria = "[CompanyName]=" & "'" & Me![CompanyName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_EditCompanyInfo_Click:
Exit Sub

Err_EditCompanyInfo_Click:
MsgBox Err.Description
Resume Exit_EditCompanyInfo_Click

End Sub

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1