AutoExec working with Read Only Access

G

Guest

I have a AutoExec macro that runs when the database is first opened to update
tables. If the database is opened in Read-Only mode, the macro bugs. Is
there a code to enter to by-pass the update portion of the routine?
 
W

Wolfgang Kais

Hello "bbrown".

bbrown said:
I have a AutoExec macro that runs when the database is first opened
to update tables. If the database is opened in Read-Only mode, the
macro bugs. Is there a code to enter to by-pass the update portion
of the routine?

Create a satndard module and insert the following VBA funciton:

Public Function IsUpdatable() As Boolean
IsUpdatable = CurrentDb.Updatable
End Function

Then, in you marco, you can use the condition IsUpdatable() in the
conditions column for the first update query that is to be executed.
For subsequent update actions, use ... (three dots) as condition.
 

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