In my form I've got a subform set up with a list of contacts, with a short description on them. Next to their record, it's got a button, when the button is clicked it opens a new form to display their full information.
But I run into the problem, that when I click the button on a different person instead of the first person in the list, only the first person shows up on the newly opened form. I have to cycle through the people on the list to get to said person I clicked.
Is there a way that I can have it so when I pass the information from the sub-report, to a new main form...this is the current code I'm using.
Private Sub Command21a_Click()
On Error GoTo Err_Command21a_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
If IsNull(Me![CompanyCode]) Then
MsgBox ("You cannot open this trade show form because it does not exist. You must enter form information before it can be opened.")
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Trade Show"
stLinkCriteria = "[CompanyCode]='" & Me.CompanyCode & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria