Bypassing Access Startup form from VB

  • Thread starter Thread starter TimothyDias
  • Start date Start date
T

TimothyDias

Hi,

I have a database that is set up to open with only a form showing and
no toolbars, database window, etc. I did this by modifying the startup
options. I know I can hold down shift while opening the database to
bypass this and see the database window. I was curious if there were
any way that I could do this in VB?? What I am trying to do is open the
database from excel (which I can do no problem) but I want it to open
without the form and instead open as it would if I were holding down
shift.

Thanks for any help - Tim
 
Thanks for any help - Tim

Do you need to actually open the database, or just a table?

If you just need data, then don't launch the application. Use

Dim MyDb As dao.Database

dim rst as dao.RecordSet

Set MyDb = OpenDatabase("c:\path to database\mydb.mdb")


set rst = MyDb.OpenReocrdSet("select * from tblCustomer")

If you do the above, then the startup form is NOT launched..

If you use automation, then, the startup form does run. If it is a startup
macro, then you *can* overwrite the macro BEFORE you launch the
application....
 
I actually just need to run a macro within the database...I do NOT need
it to open. Please let me know if there is a way I can just get the
macro to run without opening the database. The macro runs several
maketable and append queries along with importing some data.

Thanks alot - Tim
 
Hi,

I have a database that is set up to open with only a form showing and
no toolbars, database window, etc. I did this by modifying the startup
options. I know I can hold down shift while opening the database to
bypass this and see the database window. I was curious if there were
any way that I could do this in VB?? What I am trying to do is open
the database from excel (which I can do no problem) but I want it to
open without the form and instead open as it would if I were holding
down shift.

Thanks for any help - Tim

I've never tried it, but I think Dev Ashish's code at the following link
will do it for you.

http://www.mvps.org/access/api/api0068.htm
API: Bypassing Autoexec
 
I actually just need to run a macro within the database...I do NOT need
it to open. Please let me know if there is a way I can just get the
macro to run without opening the database. The macro runs several
maketable and append queries along with importing some data.

Why not just reproduce the macro stuff in code as I showed. You could also
consider "linked" tables, so stuff like transfertxt etc can be used.

Another possbile is to crteate a small mdb with linked talbes, and JUST the
code/macros you need, and have that run when you luanch this small mdb.

So, no...I don't reaqlly know of a way around this.

Between the two above suggestions, you should at least have a workable
procedure.
 

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

Back
Top