View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Neily[_3_] Neily[_3_] is offline
external usenet poster
 
Posts: 26
Default Controlling Access from Excel

Hi,

I've been reading up on controlling various Office applications from other
Office Applications.

Right now, I'm trying to control Access from Excel and wondered if anyone
could tell me how to run a DoCmd statement on Access from Excel

Here's what I have so far.

Sub ControlAccessFromExcel()

Set objAccess = CreateObject("Access.Application")
Set objDatabase = objAccess.Database.Open("[access db filepath]")

objDatabase.DoCmd.RunSQL "SELECT...."

End Sub

Now I'm pretty sure that the word "Database" in the line
objAccess.Database.Open("[access db
filepath]")
is wrong. Does anyone know the correct syntax for this or if I'm
completely barking up the wrong tree.

Secondly, is the syntax for the line....
objDatabase.DoCmd.RunSQL "SELECT...."
..........correct?

Ta

Neil