Share via

Help Creating a Button to Open Subform

Anonymous
2018-11-27T22:26:22+00:00

Hi,

Can someone help me create a button that will open my subform?  Access creates the links between the parent and the child form if it is embedded directly on the parent form, but I wanted to create a button that will only open the subform if the user clicks on the button.  I tried using what access provided through the button wizard, but it's not working properly.

On Error GoTo Err_AliasButton_Click

    Dim stDocName As String

    Dim stLinkCriteria As String

    stDocName = "AliasForm"

    stLinkCriteria = "[MemberID]=" & Me![MemberID]

    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_AliasButton_Click:

    Exit Sub

Err_AliasButton_Click:

    MsgBox Err.Description

    Resume Exit_AliasButton_Click

Thanks!

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments