I'm trying to write a small SQL query that will allow me to open a form only with that person records. This is in Access 2003. The error I'm getting is a syntax error in the query
VB Code:
' Dim variables used Dim stDocName As String Dim stLinkCriteria As String ' Form name is 1486 stDocName = "1486" ' Find out who is selected in the Employee combo box and make SUPER (text box on 1486) equal to that person (so it will filter records by the person) stLinkCriteria = "[SUPER]=" & "'" & Me.cboEmployee & "'" ' Create query that selects only the records of that person sSQL = "SELECT * FROM 1486 WHERE stLinkCriteria" ' Open the form DoCmd.OpenForm stDocName, , , sSQL




Reply With Quote