Question : Opening Another Form Filtered with a Button

Hello,
  I am using Access 2007 with two forms. Just starting out VBA programming.

  On the first form called frm_ChangeManagement, I have a combo box with the list of applications, using AppID to pass the value. I created a button next to the combo box to open a second form, called frm_ApplicationsMatrix. The second form would output the results using the AppID.

  I was able to open the second form as a starting point. However, when I tried to use filter commands to output the results on the second form using the value of AppID, I got an error of 424 Object Required. I had thought I fixed it by using a Code Builder using OpenEvent property with a blank value as a workaround, but it did not last long.

  I appreciate for any insight.
Code Snippet:
1:
2:
3:
4:
5:
6:
Private Sub OpenFormFilter_Click()
  DoCmd.OpenForm "frm_ApplicationsMatrix", acNormal
  Form_frm_ApplicationsMatrix.Filter = "Forms!frm_ChangeManagement!AppID"
  Form_frm_ApplicationsMatrix.FilterOn = True
  
End Sub

Answer : Opening Another Form Filtered with a Button

copy and paste this

DoCmd.OpenForm "frm_ApplicationsMatrix", acNormal, , "[AppID]=" & AppID

Random Solutions  
 
programming4us programming4us