Running queries with VBA functions in external database

  • Thread starter Sergey Poberezovskiy
  • Start date
S

Sergey Poberezovskiy

Hi,

I have an (update) query that utilizes my Custom VBA
function (BitAnd). I need to run this query from within
another database. The code (attached below) runs without
errors, but records do not update.
On another hand, when I step thru the code line by line,
everything seems to work just fine.
Could anyone please help?!!

The code:

Dim oAccess As Access.Application
Set oAccess = New Access.Application
oAccess.OpenCurrentDatabase vsDatabase
With oAccess.DoCmd
.SetWarnings False
.OpenQuery "qryUpdateTempScores"
End With
oAccess.CloseCurrentDatabase

Any help is greatly appreciated.
 
S

Sergey Poberezovskiy

Originally I was running without setting the warnings off
with the same result. But I thought as if you are trying
to execute DoCmd.OpenQuery actionQueryName in the same
database - it comes up with a confirmation, so I tried to
turn them off through Automation, just in case. They do
not seem to make any difference.

Any other ideas???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top