Hi guys
I want to display the result of a query from Access table to Excel spreadsheet. I have written the following code to fetch the data from the Access table but have no idea how to display that in excel sheet. Can anyone please help me out in this.
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim r As Long
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=C:\Documents and Settings\Amanpreet Kaur\Desktop\resc.mdb;"
Set rs = New ADODB.Recordset
rs.Open "tblmain", cn, adOpenKeyset, adLockOptimistic, adCmdTable
rs.Find "Department = ' " & ComboBox1.Value & " '
Thanks in advance!!
Aman
Bookmarks