![]() ![]() ![]() The default view is like the List view in Windows, where subitems are not shown. Setting View equal to lvwReport is similar (exactly) like choosing Details when youre viewing a Windows Explorer window. The HideColumnHeaders property is False by default, but I set it in code explicitly. I set the first two columns width equal to the controls above and just threw in a number for the Current column. In addition to filling the Department combobox, the Activate event adds three columns to the ListView via the ColumnHeaders.Add method. Records Print out the records to make sure I didnt miss something For i 1 To colRecords. Question is how can I, maybe in an event following the click of a button I can add on the form, get the reference to the rows user clicks? Otherwise the whole think is useless.Set colRecords New Collection Set colRecords FillRecords Create a new instance of the userform rather than relying on the default instance Set ufScroll New UScroll2 Load the records into a custom property of the userform Set ufScroll.Ĭode is suspended at this point Get the new records, if any, from the userforms property Set colRecords ufScroll. MsgBox "Error: " & Err.Number & Chr(13) & _Īnd then I am calling the function like this:Ĭall FillList("Query for Cards 2", ListView1) ' Ignore Error 94 which indicates you passed a NULL value. ![]() NewLine.SubItems(intCount2) = rs(intCount2).Value Set NewLine = LV.ListItems.Add(,, rs(0).Value) Set NewLine = LV.ListItems.Add(,, Str(rs(0).Value)) ' Loop through recordset and add Items to the control. LV.View = 3 ' Set View property to 'Report'. Set colNew = LV.ColumnHeaders.Add(,, rs(intCount1).Name) ' Returns: A Boolean value to indicate if the function wasĭim intCount1 As Integer, intCount2 As Integerĭim colNew As ColumnHeader, NewLine As ListItem ' Arguments: a Domain which is the name of the table or query, and ' Purpose: to fill a ListView control with data from a table or " Function FillList(Domain As String, LV As Object) As Boolean I do not like the standard listbox options since I do not find them so user friendly when using a long list and needing to have a clear indication of what is chosen and what is not.Īs to the Listview I have used a code I found around to populate the listview: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |