I'm stuck on a problem and not sure where to go for help.
I want to take an existing excel spread sheet, select a singular cell, and build a Dsum function that will look inside an access database and pull out the sum of a "cost" field based on the criteria of a seperste field in that same access table.
You have to build an ADO connection then copyFromRecordset
Public Sub CopyRST()
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
uid = "username"
pwd = ""
DB = "c:\file\MyDb.mdb"
vProvid = "Microsoft.Jet.OLEDB.4.0" ' "SQLOLEDB"
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("User ID").Value = uid
.Properties("Password").Value = pwd
.Open "Data Source=" & DB
Set rs = con.Execute("qsMyQuery")