I am getting a syntax error missing operator when I try to created a record set by selecting a record from a list box. I do not know where the error is though. Everything looks good, as a matter of fact I have very similar code elsewhere in my program and it works perfectly. Here is the code
So what I want it to fill in some text boxes with data from the record set. If I replace & Me.lstRequests. Column(0) with a number i know exists, everything works fine. Any help?
Code:
Private Sub lstRequests_Click()
Dim dbs As DAO.Database
Dim rs5 As DAO.Recordset
Set dbs = CurrentDb
lstRequests.RowSource = "Value List"
lstRequests.ColumnCount = 4
lstRequests.RowSource = "Request ID; Date Opened; Status; Date Closed"
Set rs5 = dbs.OpenRecordset("SELECT * FROM Request WHERE Request_ID =" & Me.lstRequests.Column(0))
Me!txtODate = rs5(1)
Me!cmbColor = rs5(2)
Me!txtQuantity = rs5(3)
Me!cmbstatus = rs5(4)
Me!txtCDate = rs5(5)
Me!cmbCategory = rs5(6)
Me!cmbAction = rs5(7)
Me!txtNotes = rs5(8)
Me!txtCON = rs5(9)
Me!txtPON = rs5(10)
Me!cmbRM = rs5(12)
Me!txtCS = rs5(13)
Me!cmbDist = rs5(14)
End Sub
Comment