Howdy,
I've made several listviews (Microsoft Listview Control, Version 6.0) and now I'm getting a type mismatch error. When the form opens I am calling a sub in a module to create and fill the list view. I highlighted where I am getting the error. Am I getting this because I am trying to create it during the Form Open event? Any advice would be great!
Sub Fill_Capacity_ListView()
Dim strSQL As String
Dim LView As ListView
Dim lstitem As ListItem
Dim db As Database
Dim rst As DAO.Recordset
Set db = CurrentDb
strsq = "SELECT * FROM tblcapacity;"
Set LView = Form_frmcapacitysettings.lstview.Object
With LView
.ListItems.Clear
.View = lvwReport
End With
With LView.ColumnHeaders
.Add , , "Incr", 0
.Add , , "Area", 1200
.Add , , "Rate", 1200
.Add , , "Hours/Day", 1200
.Add , , "Days/Week", 1200
End With
I've made several listviews (Microsoft Listview Control, Version 6.0) and now I'm getting a type mismatch error. When the form opens I am calling a sub in a module to create and fill the list view. I highlighted where I am getting the error. Am I getting this because I am trying to create it during the Form Open event? Any advice would be great!
Sub Fill_Capacity_ListView()
Dim strSQL As String
Dim LView As ListView
Dim lstitem As ListItem
Dim db As Database
Dim rst As DAO.Recordset
Set db = CurrentDb
strsq = "SELECT * FROM tblcapacity;"
Set LView = Form_frmcapacitysettings.lstview.Object
With LView
.ListItems.Clear
.View = lvwReport
End With
With LView.ColumnHeaders
.Add , , "Incr", 0
.Add , , "Area", 1200
.Add , , "Rate", 1200
.Add , , "Hours/Day", 1200
.Add , , "Days/Week", 1200
End With