AutoExec working with Read Only Access

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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.
 
Back
Top