Hello,,
I have a code below, for some reason if i want to add the line "Order by" the code doesn't work. I'm not sure if it a syntax error. Any help would be highly appreciated
Here is the code
Private Sub CustomerList_AfterUpdate()
With Me.ContactList
.RowSource = _
"Select ID, CustomerID, Firstname, Lastname, Phone, Email From tblcustomercontact " & _
"Where CustomerID = " & Me.CustomerList
' "Order by ID Desc"
.ColumnCount = 6
.ColumnWidths = ".31in;.5in; 1.1 in; 1 in; 1 in;1 in;"
.ColumnHeads = True
.Requery
End With
End Sub
I have disabled the order line above and my listbox will populate, but enabling it won't.
I have a code below, for some reason if i want to add the line "Order by" the code doesn't work. I'm not sure if it a syntax error. Any help would be highly appreciated
Here is the code
Private Sub CustomerList_AfterUpdate()
With Me.ContactList
.RowSource = _
"Select ID, CustomerID, Firstname, Lastname, Phone, Email From tblcustomercontact " & _
"Where CustomerID = " & Me.CustomerList
' "Order by ID Desc"
.ColumnCount = 6
.ColumnWidths = ".31in;.5in; 1.1 in; 1 in; 1 in;1 in;"
.ColumnHeads = True
.Requery
End With
End Sub
I have disabled the order line above and my listbox will populate, but enabling it won't.