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
Wildcards in an Access IIF statement
How do I select a specific column based on a variable in a MS Access query?
MS access columns to rows
Windows 7 VirtualStore with Access 2010 and FtpGetFile
Maximum Field Reached for Access 2007
indexing without duplicate and that imapct on speed of data retrieval
Issue using Access DoCmd.Rename on table: linked names not renamed
accde ran using runtime stops any code from executing
How can I use the database commands 'Seek' and results 'NoMatch'?
Adding multiple records to a table using radio buttons and check boxes, Access 2003
Get caption of closed report
Query access db using silverlight in an oob app with full trust?
runing a query of combinationfield in runtime,how?
Vim macro with ^M doesn't work
Infinitely looping through a recordset in VBA
Issue with the TOP 1 query