Hi
Been trying to open Form2 via a button on a subform (Subform1) which resides on MainForm1. I also want to filter the data based upon a value (Field1) on MainForm1 - been struggling with referencing mainform value despite looking at various posts/websites.
Code so far (will work if button is on the MainForm1 as I used cmd button wizard):
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Form2"
stLinkCriteria = "[Field1]=" & "'" & Me![Field1] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Any assistance would be appreciated
Been trying to open Form2 via a button on a subform (Subform1) which resides on MainForm1. I also want to filter the data based upon a value (Field1) on MainForm1 - been struggling with referencing mainform value despite looking at various posts/websites.
Code so far (will work if button is on the MainForm1 as I used cmd button wizard):
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Form2"
stLinkCriteria = "[Field1]=" & "'" & Me![Field1] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Any assistance would be appreciated