Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Import data from Access Data Base

Hi All, I am using the Office 2000 package.

I have created a template that has numerous Vlookups and
referances to data in a control sheet.

Currently the data that lives in the Control sheet has to
be updated every time a new employee is hired or switches
positions.

This data is already updated via a Access database
employee tbl.

Can anyone help me automate the update of the control
sheet data?

I can't point the main sheet direct to the data base
because...
a) I don't know how and
b) the template is made availible off-line but the Data
base is not


So I think if I can figure out a way to import the data
into my Conrol sheet on demand with the click of a button
I would be a local hero. then I'll share my hero biskit
with you all :0)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Import data from Access Data Base

This example copies data from a table named "Employees" in
the database "database.mdb" on the C: drive to Sheet1
beginning at cell "A1" of your Excel spreadsheet. In the
Visual Basic Editor, under "Tools/References" be sure to
have "Microsoft DAO 3.6 Object Library" selected.

Sub ImportTable()

Dim DB As Database, RS As Recordset
Set DB = OpenDatabase("C:\database.mdb")
Set RS = DB.OpenRecordset("Employees")

Sheets(1).Range("A1").CopyFromRecordset RS

End Sub

Just substitute your database path and table name as
needed.

Hope this helps.
Tokash

-----Original Message-----
Hi All, I am using the Office 2000 package.

I have created a template that has numerous Vlookups and
referances to data in a control sheet.

Currently the data that lives in the Control sheet has to
be updated every time a new employee is hired or switches
positions.

This data is already updated via a Access database
employee tbl.

Can anyone help me automate the update of the control
sheet data?

I can't point the main sheet direct to the data base
because...
a) I don't know how and
b) the template is made availible off-line but the Data
base is not


So I think if I can figure out a way to import the data
into my Conrol sheet on demand with the click of a button
I would be a local hero. then I'll share my hero biskit
with you all :0)
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Import data from Access Data Base

To expand on the previous answer

http://www.erlandsendata.no/english/vba/adodao/
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel user enter a store # to query Access data base liem Excel Discussion (Misc queries) 0 January 16th 10 03:45 AM
Import Data from Access toby131 Excel Discussion (Misc queries) 3 October 27th 09 11:47 PM
Chart connected to an Access data base Maracay Charts and Charting in Excel 2 December 4th 08 02:12 AM
Can't import data to access Amin Excel Discussion (Misc queries) 3 September 26th 08 04:56 AM
Access data base is able to store any number of records clearcell Excel Worksheet Functions 0 November 8th 05 08:45 PM


All times are GMT +1. The time now is 01:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"