I have a form which contains 3 combo boxes (cboProdDate, cboLocation, and cboItem) and a command button that opens a form frmupdate2.
Here is the on click event procedure:
Private Sub cmdupdate2_Click()
On Error GoTo Err_cmdupdate2_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmUpdate2"
stLinkCriteria = ("[Item]=" & "'" & Me![cboItem] & "'") & ("[Production Date]=" & "#" & Me![cboProdDate] & "#") & ("[Location]=" & "'" & Me![cboLocation] & "'")
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdupdate2_Click:
Exit Sub
Err_cmdupdate2_Click:
MsgBox Err.Description
Resume Exit_cmdupdate2_Click
End Sub
The problem is when I click the button I get the following error message:
"Syntax error (missing operator) in query expression '[Item]='B00800800'[Production Date]=#3/23/2004#[Location]='WP".
Any idea what syntax error I have?
Thanks.
ps. I use Access 97.
Here is the on click event procedure:
Private Sub cmdupdate2_Click()
On Error GoTo Err_cmdupdate2_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmUpdate2"
stLinkCriteria = ("[Item]=" & "'" & Me![cboItem] & "'") & ("[Production Date]=" & "#" & Me![cboProdDate] & "#") & ("[Location]=" & "'" & Me![cboLocation] & "'")
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdupdate2_Click:
Exit Sub
Err_cmdupdate2_Click:
MsgBox Err.Description
Resume Exit_cmdupdate2_Click
End Sub
The problem is when I click the button I get the following error message:
"Syntax error (missing operator) in query expression '[Item]='B00800800'[Production Date]=#3/23/2004#[Location]='WP".
Any idea what syntax error I have?
Thanks.
ps. I use Access 97.