Hi,
Could anyone give a solution for display the msaccess data into the excel spreadsheet.
I am having the code to display it on Listbox but needed to display on the worksheet2.
code:
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Open _
"Provider = Microsoft.ACE.OLEDB.12.0; " & _
"Data Source = C:\Users\a.accdb"
ComboText = ComboBox1.Text
'objRecordset.Open " select col1 FROM tab1", _
'objConnection
objRecordSet.Open " select co1 FROM tab where col1 ='" & ComboText & "' order by ScenId ", _
objConnection
objRecordSet.MoveFirst
Count = 0
Do Until objRecordSet.EOF
:::::::Need to add the code here
'activesheet.
'Set list_item = ListView1.ListItems.Add(, , objRecordSet!col1)
'Item = objRecordset(Count).value
'InputScreen.ComboBox1.AddItem (Item)
objRecordSet.MoveNext
Loop
objRecordSet.Close
objConnection.Close
Could anyone give a solution for display the msaccess data into the excel spreadsheet.
I am having the code to display it on Listbox but needed to display on the worksheet2.
code:
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Open _
"Provider = Microsoft.ACE.OLEDB.12.0; " & _
"Data Source = C:\Users\a.accdb"
ComboText = ComboBox1.Text
'objRecordset.Open " select col1 FROM tab1", _
'objConnection
objRecordSet.Open " select co1 FROM tab where col1 ='" & ComboText & "' order by ScenId ", _
objConnection
objRecordSet.MoveFirst
Count = 0
Do Until objRecordSet.EOF
:::::::Need to add the code here
'activesheet.
'Set list_item = ListView1.ListItems.Add(, , objRecordSet!col1)
'Item = objRecordset(Count).value
'InputScreen.ComboBox1.AddItem (Item)
objRecordSet.MoveNext
Loop
objRecordSet.Close
objConnection.Close