I`m trying to populate a list box dynamically depending on an SQL query when different conditions are met. I can do this easily when using access2002 with the .AddItem command, however when using access97 this command does not appear and so the code does not work.
Suggestions on getting round this problem?
The list box is populated with a set of data from one column eg below:
Set db = CurrentDb()
Set rst = db.OpenRecordset(strSQL, dbOpenSnapshot)
If rst.EOF And getuserRole = 3 Then
MsgBox "You have no changes to impact", vbInformation
Cancel = True
Else
With rst
.MoveFirst
Do While True
lstImpacts.AddItem = rst("catnumber")
rst.MoveNext
Loop
.Close
End With
End If
Set rst = Nothing
How do I get the above to work in 97?
Suggestions on getting round this problem?
The list box is populated with a set of data from one column eg below:
Set db = CurrentDb()
Set rst = db.OpenRecordset(strSQL, dbOpenSnapshot)
If rst.EOF And getuserRole = 3 Then
MsgBox "You have no changes to impact", vbInformation
Cancel = True
Else
With rst
.MoveFirst
Do While True
lstImpacts.AddItem = rst("catnumber")
rst.MoveNext
Loop
.Close
End With
End If
Set rst = Nothing
How do I get the above to work in 97?