Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Bypassing Access Startup form from VB

Discussion in 'Information Technology' started by TimothyDias@gmail.com, Jul 28, 2006.

  1. TimothyDias@gmail.com

    TimothyDias@gmail.com
    Expand Collapse
    Guest

    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
     
  2. Loading...


  3. Albert D.Kallal

    Albert D.Kallal
    Expand Collapse
    Guest

    > 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....


    --
    Albert D. Kallal (Access MVP)
    Edmonton, Alberta Canada
    pleaseNOOSpamKallal@msn.com
    http://www.members.shaw.ca/AlbertKallal
     
  4. TimothyDias@gmail.com

    TimothyDias@gmail.com
    Expand Collapse
    Guest

    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



    Albert D.Kallal wrote:
    > > 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....
    >
    >
    > --
    > Albert D. Kallal (Access MVP)
    > Edmonton, Alberta Canada
    > pleaseNOOSpamKallal@msn.com
    > http://www.members.shaw.ca/AlbertKallal
     
  5. Dirk Goldgar

    Dirk Goldgar
    Expand Collapse
    Guest

    <TimothyDias@gmail.com> wrote in message
    news:1149699715.448158.155140@y43g2000cwc.googlegroups.com
    > 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

    --
    Dirk Goldgar, MS Access MVP
    www.datagnostics.com

    (please reply to the newsgroup)
     
  6. Albert D.Kallal

    Albert D.Kallal
    Expand Collapse
    Guest

    <TimothyDias@gmail.com> wrote in message
    news:1149701486.425949.207390@h76g2000cwa.googlegroups.com...
    >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.

    --
    Albert D. Kallal (Access MVP)
    Edmonton, Alberta Canada
    pleaseNOOSpamKallal@msn.com
    http://www.members.shaw.ca/AlbertKallal
     

Share This Page