Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Access 7 to Access 2003 using Excel VBA

  Asked By: Waldemar    Date: Jan 05    Category: MS Office    Views: 1109
  

I'm an old Access 7 user, and very
familiar with the DAO 3.51 Library.
It seems that it is time for me to
get with it and learn the Access 11.0
Object Library.

But the terminology is so different,
I'm getting nowhere using the VBA help
screens. Could somebody please give me
a few code snippets for:

1. Open a database (mdb) and recordset
2. Add a record
3. Edit a record

I would like to do the above under program
control (i.e., using Excel VBA)

What I'm familiar with:

1. Open a database (mdb) and recordset

Dim DB1 As Database
Dim RS1 As Recordset
Set DB1 = Workspaces(0).OpenDatabase("c:\myMDB.mdb")
Set RS1 = DB1.OpenRecordset("names", dbOpenTable)

2. Add a record

RS1.AddNew
RS1("id") = "BA109002"
RS1("last") = "Smith"
RS1("first") = "Joe"
RS1.Update

3. Edit a record (after getting there by "seek")

RS1.Index = "id"
RS1.Seek "=", "BA109002"
RS1.Edit
RS1("last") = "Smythe"
RS1.Update

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Access 7 to Access 2003 using Excel VBA Or get search suggestion and latest updates.




Tagged: