R
Rick
Greetings,
I have the following code and I get a "The OpenForm action was
cancelled" message.
Private Sub btnThisWeeksGames_Click()
On Error GoTo Err_btnThisWeeksGames_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmGames"
stLinkCriteria = "[Season]='" & Me![cboSeasonID] & "' AND [Week]='"
& Me![cboWeek] & "'"
Debug.Print stLinkCriteria
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_btnThisWeeksGames_Click:
Exit Sub
Err_btnThisWeeksGames_Click:
MsgBox Err.Description
Resume Exit_btnThisWeeksGames_Click
End Sub
The Debug.Print statement yields [Season]='2005/2006' AND [Week]='9'
If I change it to stLinkCriteria = "[Season]='" & Me![cboSeasonID] &
"'"
it works just fine.
Please help a dumb Texan.
I have the following code and I get a "The OpenForm action was
cancelled" message.
Private Sub btnThisWeeksGames_Click()
On Error GoTo Err_btnThisWeeksGames_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmGames"
stLinkCriteria = "[Season]='" & Me![cboSeasonID] & "' AND [Week]='"
& Me![cboWeek] & "'"
Debug.Print stLinkCriteria
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_btnThisWeeksGames_Click:
Exit Sub
Err_btnThisWeeksGames_Click:
MsgBox Err.Description
Resume Exit_btnThisWeeksGames_Click
End Sub
The Debug.Print statement yields [Season]='2005/2006' AND [Week]='9'
If I change it to stLinkCriteria = "[Season]='" & Me![cboSeasonID] &
"'"
it works just fine.
Please help a dumb Texan.