calvinle
09-11-2014, 12:47 PM
Hi guys,
I am new to VBA Access, and I will need to work with ListView because that is the most thing that I am familiar with but on Excel.
Because I am using Access to manipulate an external application, so I will not need to store any data in the tables in Access, but only need it as a compiler for the VBA macro. I have used Excel userform, but due to the fact that many of my data is in Excel, it's not pleasant to switch from Userform Excel to Excel sheet, back and forth.
So I want to use Access VBA to control the external application.
All I need to do is to have a ListView in Access with preloaded items in 4 category in vba code.
Here is what I have started
Option Compare Database
Private Sub cmdRetrieve_Click()
Call Retrieve
End Sub
Private Sub Retrieve()
'On Error GoTo EXIT_DOOR
Dim ListView1 As MSComctlLib.ListView
With ListView1
'.ListItems.Clear
.ListItems.Add , , "Data 1"
.ListItems(i).ListSubItems.Add , , "Data 2"
.ListItems(i).ListSubItems.Add , , "Data 3"
.ListItems(i).ListSubItems.Add , , "Data 4"
End With
End Sub
Hope anyone can help.
I am new to VBA Access, and I will need to work with ListView because that is the most thing that I am familiar with but on Excel.
Because I am using Access to manipulate an external application, so I will not need to store any data in the tables in Access, but only need it as a compiler for the VBA macro. I have used Excel userform, but due to the fact that many of my data is in Excel, it's not pleasant to switch from Userform Excel to Excel sheet, back and forth.
So I want to use Access VBA to control the external application.
All I need to do is to have a ListView in Access with preloaded items in 4 category in vba code.
Here is what I have started
Option Compare Database
Private Sub cmdRetrieve_Click()
Call Retrieve
End Sub
Private Sub Retrieve()
'On Error GoTo EXIT_DOOR
Dim ListView1 As MSComctlLib.ListView
With ListView1
'.ListItems.Clear
.ListItems.Add , , "Data 1"
.ListItems(i).ListSubItems.Add , , "Data 2"
.ListItems(i).ListSubItems.Add , , "Data 3"
.ListItems(i).ListSubItems.Add , , "Data 4"
End With
End Sub
Hope anyone can help.