Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to write code (in Excel's Visual Basic)
that accesses an Access database and deletes all current records? I want all of this to happen when the user hits a button that says "update". What I am trying to accomplish is to download the existing data out of Access, edit the data in Excel, remove the old records in Access and import the updated records from Excel. The only part I can't figure out is how to delete the existing records in Access so that I don't have duplicate enrties when I upload the refrshed data from Excel. Can anyone help? I'd be so grateful! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to write code (in Excel's Visual Basic)
that accesses an Access database and deletes all current records? I want all of this to happen when the user hits a button that says "update". Sub macro1() ' Microsoft DAO x.x Object Library at menu ' Tools | References must be checked Dim rs As Recordset Dim db As Database Set db = OpenDatabase("c:\path\filename.mdb") Set rs = db.OpenRecordset("Table1") Do rs.Delete rs.MoveNext Loop Until rs.EOF Set rs = Nothing Set db = Nothing End Sub HTH, Merjet |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks so much for the information. When you wrote
Tools/ References must be checked, is that in Excel? Is it under Tools? Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Shin,
In the VBA editor, go to the Tools menu, choose References, and in that dialog check the appropriate item in the list box. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Shin" wrote in message ... Thanks so much for the information. When you wrote Tools/ References must be checked, is that in Excel? Is it under Tools? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how i can do programming in MS Excel.? | Excel Worksheet Functions | |||
ADO programming in Excel-VBA | Excel Discussion (Misc queries) | |||
export access to excel. change access & update excel at same time | Excel Discussion (Misc queries) | |||
Excel Programming in VB | Excel Programming | |||
Excel Programming in VB | Excel Programming |