I have a form1 (frmEmployee_Audits) that has a button that opens a form2 (frmScorecard_Sections).
What I want to do is when the button on form1 (frmEmployee_Audits) is clicked and it opens form2, (frmScorecard_Sections), I want it to take the data in the field cboEmployee on form1 (frmEmployee_Audits) and place that data in the field Employee on form2 (frmScorecard_Sections).
I have posted my code in the Code section, but I am getting the following error:
“Syntax error in string in query expression ‘Forms![frmScorecard_Secti
oyee] = ‘Steven Jones – JONESST””.
What am I doing wrong?
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmScorecard_Sections"
'stLinkCriteria = "[Employee]=" & "'" & Me![cboEmployee] & "'"
'stLinkCriteria = "Forms![frmScorecard_Sections subform].[Employee] = " & " '" & Me.cboEmployee & "'"
DoCmd.OpenForm stDocName, , , "Forms![frmScorecard_Sections].[Employee] = " & " '" & Me.cboEmployee & "'"""