I am trying to open an Access DB in an Excel VBA. This following code works well, but now I would like to filter the the records by one of the fields in the table "data". Can I add a SQL statement somehow to accomplish that?
Here is my simple example:
Sub GetTable2()
Dim rs As Recordset
Set rs = DBEngine.OpenDatabase("C:\Sales\StoreDB.mdb"
.OpenRecordset("data"
Range("A1"
.CopyFromRecordset rs
End Sub
Dean
Here is my simple example:
Sub GetTable2()
Dim rs As Recordset
Set rs = DBEngine.OpenDatabase("C:\Sales\StoreDB.mdb"
Range("A1"
End Sub
Dean