Highlight rows in listbox from values in recordset
On my forms Load event I'm loading a list of clients from sql table. On my Current even I'm trying to loop the listbox and highlight rows from my recordset. I have this but it's not working. what am I missing? For i = 0 To Me.ClientList.ListCount - 1 If Me.ClientList.Column(0, i) = rs.Fields(0) Then Me.ClientList.Selected(i) = True rs.MoveNext End If Next
What I found out was that the Me.ClientList.ItemData was text value and rs.Fields(0) was int. So use CInt to convert and it will evaluate correctly. Hope this helps. If CInt(Me.ClientList.ItemData(i)) = rs.Fields(0) Then Me.ClientList.Selected(i) = True rs.MoveNext End If
MS Access Form Insertion Hidden value
Open an external file with a button on a form in Access 2007
Find function in Form Code Module
Docmd.Runsql Updating Select Max records by group
MS Access Can't Link to Encrypted Backend Database
Why is my LEFT JOIN an invalid operation (MS ACCESS 2003)
IIS7.5 MS Access Authentication
Getting a “Variable Not Defined” error when attempting to open a table in Access 2010
MS Access Report “per detail” formatting and accessing in VBA
Open form in access using criteria?
Temporarily change printer page size then revert back in Access 2007 using VBS
How to combine more than 2 Microsoft Access tables into one table?
Access mdb not giving correct result
MS Access Macro to change form to No data entry
setting control source property of a textbox of subform in its parent form in ms access?
I need to dynamically (and quickly) import part of the data in an Access table (a large one) into Excel