MS Access Records
Your question can have a few different answers. You can put code in a loop
to extract the data. You need to move down one row at a time and then read
the data from the field(s) you want.
You can extract an entire table if you want depending on how you have yur
database setup. Excel can read predefined tables and query from Access.
One thing you can do is in excel start the macro recorder. then perform a
query by using the worksheet menu Data - Import External data - New Database
Query. Select Access as the database and browse for the MDB file. Then
select the option you want to import into excel. You can then use the
recorded macro in your own macro. You can also modify the recorded macro as
required.
"Varne" wrote:
Hi
The following can extract data from one row in an Access table;
(Connection and Recordset declared)
ThisWorkbook.Sheets(3).Cells(h, i).Value = rs.Fields(i).Value
But does Access has something similar to Cells(h,i) to enable extracting
data of a whole table using a 'For Loop'.
Can someone help?
Thanks.
|