Reputation: 49
I want display table data in a list box with this code:
Me.List_history.RowSource = "SELECT Date " & _
"FROM Leaves " & _
"WHERE CodePersonali = " & Nz(Me.CodePersonali.Value)
but the list box doesn't display anything
List_history
= my list box name
Date
= field name in leave
table
Upvotes: 0
Views: 1042
Reputation: 27634
Date
is a reserved word (it's a function), so you shouldn't use it as column name. If you must, put it between square brackets [Date]
.
If CodePersonali
is a text column, you need to put the value between ''
.
That would be
Me.List_history.RowSource = "SELECT [Date] " & _
"FROM Leaves " & _
"WHERE CodePersonali = '" & Nz(Me.CodePersonali.Value) & "'"
Upvotes: 1