I need to pick up search results from a table and display them in a
listbox. I've made a simple 2-column listbox and the following code
returns "Object Required" on the Me.ListBox.Column(0,0) lines.
What's the solution?
Here's the code:
-- snip --
Private Sub SearchButton_Click()
Dim query As String, myDate As String, rs As Recordset
DateBox.SetFocus
query = "SELECT Through,Amount FROM ExpDaily WHERE Date=" &
DateBox.Text & ";"
MsgBox (query)
Set rs = CurrentDb.OpenRecordset(query)
If rs.RecordCount <> 1 Then
Me.ListBox.Column(0, 0) = "None"
Else
Me.ListBox.Column(0, 0) = rs!Through
End If
...
-- snip --