A
Alex
I have a command button in a form which opens a new form,
which is linked by test_id.
When i click the command button, I get an error message
saying "syntax error (missing operator) in query
expression '[test_id]='
Does anyone know what is the problem with the code?
The code (which was generated by Access) is:
Private Sub Open_BB_Click()
On Error Go To Err_Open_BB_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "subfrmQA"
stLinkCriteria = "[test_id]=" & Me![test_id]
DoCmd.OpenForm stDocName,acFormDS , , stLinkCriteria
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryAppendAnswers"
[Forms]![subfrmQA].Requery
DoCmd.SetWarnings True
Exit_Open_BB_Click:
Exit Sub
Err_Open_BB_Click:
MsgBox Err.description
Resume Exit_Open_BB_Click
which is linked by test_id.
When i click the command button, I get an error message
saying "syntax error (missing operator) in query
expression '[test_id]='
Does anyone know what is the problem with the code?
The code (which was generated by Access) is:
Private Sub Open_BB_Click()
On Error Go To Err_Open_BB_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "subfrmQA"
stLinkCriteria = "[test_id]=" & Me![test_id]
DoCmd.OpenForm stDocName,acFormDS , , stLinkCriteria
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryAppendAnswers"
[Forms]![subfrmQA].Requery
DoCmd.SetWarnings True
Exit_Open_BB_Click:
Exit Sub
Err_Open_BB_Click:
MsgBox Err.description
Resume Exit_Open_BB_Click