I have a button on my form that opens a different form to a specific record using data from the form where the button was clicked. The problem is that my primary key is a combination of group number and group code. Some group numbers have 2 or 3 group codes. But there is no combination of group number/group code that is a multiple (obviously since it's the primary key). Anyway, when I went through the create button wizard I could only choose 1 field to match. I chose Group Number and sometimes it will bring up the wrong Group Number/Code combo. The auto generated code looks like this...
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Terming"
stLinkCriteria = "[GroupNumber]=" & "'" & Me![GroupNumber] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Can I add something to stLinkCriteria to add the value of the GroupCode field that's on the form too? Or can I make another variable and pass that in the same argument of the DoCmd.OpenForm? Thanks for the help
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Terming"
stLinkCriteria = "[GroupNumber]=" & "'" & Me![GroupNumber] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Can I add something to stLinkCriteria to add the value of the GroupCode field that's on the form too? Or can I make another variable and pass that in the same argument of the DoCmd.OpenForm? Thanks for the help