I am attempting to open a form on a {on_click} event where the Project # on the form to be opened will be that of the Project # on the form currently open and have set the following procedure:
Private Sub cmdTeams_Click()
On Error GoTo Err_cmdTeams_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Teams"
DoCmd.OpenForm stDocName, , [ProjectNo] = Forms![Projects]![ProjectNo], stLinkCriteria
Exit_cmdTeams_Click:
Exit Sub
Err_cmdTeams_Click:
MsgBox Err.Description
Resume Exit_cmdTeams_Click
End Sub
The error I receive is "Access cannot find the field ProjectNo referred to in your expression"! I have checked the spelling of the control on the form and underlying table and both are spelled in that manner. The field that it is getting the text string from is reading fine but it doesn't like something in the 1st [fieldname] in the where condition. Any suggestions?
Private Sub cmdTeams_Click()
On Error GoTo Err_cmdTeams_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Teams"
DoCmd.OpenForm stDocName, , [ProjectNo] = Forms![Projects]![ProjectNo], stLinkCriteria
Exit_cmdTeams_Click:
Exit Sub
Err_cmdTeams_Click:
MsgBox Err.Description
Resume Exit_cmdTeams_Click
End Sub
The error I receive is "Access cannot find the field ProjectNo referred to in your expression"! I have checked the spelling of the control on the form and underlying table and both are spelled in that manner. The field that it is getting the text string from is reading fine but it doesn't like something in the 1st [fieldname] in the where condition. Any suggestions?