Hello,
I am using Access 2000. I have a list box, called lstCircuits on a form. I would like to find a way to set the rowsource one time, then filter/unfilter depending on command buttons underneath the listbox. I am running into problems because.
a) You cannot set a listbox's rowsource equal to a recordset in 2000. (right?)
b) I used this code, but ran into problems because strRowSource contained too many characters to set to the rowsource of the listbox:
Any ideas, or will I just have to requery everytime I want to set the rowsource?
I am using Access 2000. I have a list box, called lstCircuits on a form. I would like to find a way to set the rowsource one time, then filter/unfilter depending on command buttons underneath the listbox. I am running into problems because.
a) You cannot set a listbox's rowsource equal to a recordset in 2000. (right?)
b) I used this code, but ran into problems because strRowSource contained too many characters to set to the rowsource of the listbox:
Code:
Dim qdf1 As DAO.QueryDef
'Dim rst1 As DAO.Recordset
Set qdf1 = CurrentDb.QueryDefs("QRY_FRM_ENTRY_RS")
Set rst1 = qdf1.OpenRecordset()
rst1.Filter = "STATUS = 'DISCONTINUED'"
Set rst1 = rst1.OpenRecordset
Do While Not rst1.EOF
For intlngcounter = 0 To rst1.Fields.Count - 1
strRowSource = strRowSource & rst1.Fields(intlngcounter).Value & ";"
Next intlngcounter
rst1.MoveNext
Loop
'I get a too many characters error on this line
Me.lstCircuits.RowSource = strRowSource
Any ideas, or will I just have to requery everytime I want to set the rowsource?