Hi:
I have a listbox, and a recordset (DAO.Recordset).
If I clike a button, and go through the code line by line, the listbox can show the result: when hit the line:
Set Me.listBoxResult.Recordset = rs
However, if I don't go through the code line by line, just click the button, it just won't show the result in the list box.
Can you help me on this?
Below is code:
==============
Dim rs As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT [STORE], [STORE NAME],[STATE] FROM FIELD_HR_LISTT WHERE [STORE] = '0105 '"
Set rs = CurrentDb.OpenRecordset(strSQL)
If (rs.RecordCount <> 0) Then Set Me.listBoxResult.Recordset = rs
End IF
================
Thank you very much.
James
I have a listbox, and a recordset (DAO.Recordset).
If I clike a button, and go through the code line by line, the listbox can show the result: when hit the line:
Set Me.listBoxResult.Recordset = rs
However, if I don't go through the code line by line, just click the button, it just won't show the result in the list box.
Can you help me on this?
Below is code:
==============
Dim rs As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT [STORE], [STORE NAME],[STATE] FROM FIELD_HR_LISTT WHERE [STORE] = '0105 '"
Set rs = CurrentDb.OpenRecordset(strSQL)
If (rs.RecordCount <> 0) Then Set Me.listBoxResult.Recordset = rs
End IF
================
Thank you very much.
James