I have a combo box with values I type in. I also have a list box that requeries with some updates. I would like the listbox to display the table sorting by the value that was selected in the combo box. I try this:
Private Sub CmbSort_AfterUpdate()
Dim strSFSQL As String
Dim strLBSQL As String
strSFSQL = "SELECT EngLog.ID AS [Log ID], EngLog.Category, EngLog.[Project Name], EngLog.[Sales Order 1] AS [SO 1], EngLog.Description, EngLog.[Assigned To], EngLog.[Date In],EngLog.[ECN No],EngLog.[ECR No],EngLog.[Actual Date Out],EngLog.[Order Size] " & _
"FROM EngLog"
'strLBSQL = strSFSQL & " ORDER BY EngLog.category;"
strLBSQL = strSFSQL & " ORDER BY EngLog.[cmbsort.value];"
Me!LstSearchItems.RowSource = strLBSQL
Me.LstSearchItems.Requery
Me.txtRecordCount = LstSearchItems.ListCount - 1
End Sub
Does anyone know why it won't take the cmbsort.value? Thanks in advance for anyone's time!
It's been a while since i've done this, thanks!
"The greatest risk, is not taking one."
Private Sub CmbSort_AfterUpdate()
Dim strSFSQL As String
Dim strLBSQL As String
strSFSQL = "SELECT EngLog.ID AS [Log ID], EngLog.Category, EngLog.[Project Name], EngLog.[Sales Order 1] AS [SO 1], EngLog.Description, EngLog.[Assigned To], EngLog.[Date In],EngLog.[ECN No],EngLog.[ECR No],EngLog.[Actual Date Out],EngLog.[Order Size] " & _
"FROM EngLog"
'strLBSQL = strSFSQL & " ORDER BY EngLog.category;"
strLBSQL = strSFSQL & " ORDER BY EngLog.[cmbsort.value];"
Me!LstSearchItems.RowSource = strLBSQL
Me.LstSearchItems.Requery
Me.txtRecordCount = LstSearchItems.ListCount - 1
End Sub
Does anyone know why it won't take the cmbsort.value? Thanks in advance for anyone's time!
It's been a while since i've done this, thanks!
"The greatest risk, is not taking one."