L
lmv
Can someone tell me why the ORDER BY wouldn't work in this code
cboCategoryID value is a number. I have commented it out and then the code
works not alphabetical but when I leave it in... it returns no records. I
have tried & _ at the end of the where statement... ; at the end of the Order
By and without ; ...
And I can't figure it out.
obviously a novice
Thanks!
Private Sub cboCategoryID_AfterUpdate()
Dim ProductName As String
ProductName = "SELECT [ProductsTTL].[ProductID],
[ProductsTTL].[CategoryID], [ProductsTTL].[ProductName],
[ProductsTTL].[ProductName] " & _
"FROM ProductsTTL " & _
"WHERE [CategoryID] = " & Me.cboCategoryID.Value
' "ORDER BY ProductsTTL.ProductName;"
Me.cboProductName.RowSource = ProductName
Me.cboProductName.Requery
End Sub
cboCategoryID value is a number. I have commented it out and then the code
works not alphabetical but when I leave it in... it returns no records. I
have tried & _ at the end of the where statement... ; at the end of the Order
By and without ; ...
And I can't figure it out.
obviously a novice
Thanks!
Private Sub cboCategoryID_AfterUpdate()
Dim ProductName As String
ProductName = "SELECT [ProductsTTL].[ProductID],
[ProductsTTL].[CategoryID], [ProductsTTL].[ProductName],
[ProductsTTL].[ProductName] " & _
"FROM ProductsTTL " & _
"WHERE [CategoryID] = " & Me.cboCategoryID.Value
' "ORDER BY ProductsTTL.ProductName;"
Me.cboProductName.RowSource = ProductName
Me.cboProductName.Requery
End Sub