Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2007
    Posts
    48

    Unanswered: opening Form automatically

    I have a Form I wish to display immediately the .mdb file is opened. Can anyone please advise the VBA code to do this, and where it is to be inserted

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    you don't need code.
    menu: Tools/Startup/DisplayFormPage

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Another way you can do it is by using an OpenForm action that calls up your form in a Macro called AutoExec.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Personally I create a macro called AutoExec that has a RunCode command.
    I create a public function called ApplicationOnStart in a separate module and write my code in there.

    That way... I get error handling loveliness
    George
    Home | Blog

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I use Izy's method and then a call from the open event of that form to a module for all the buffonery I want to run on start.

    No stinking macros in my apps.

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    At most there are "2 stinking macros" in my apps

    AutoExec and AutoKeys

    AutoExec only ever contains a single RunCode command; so I let it slide
    George
    Home | Blog

  7. #7
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I don't use macros in my apps but there's nothing to say that an "Autoexec" macro to do the job is wrong.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  8. #8
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Yup. AutoExec and AutoKeys are the only ones which I would ever use as well. "Stinking Macros" is a good expression
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  9. #9
    Join Date
    Dec 2007
    Posts
    48
    many thanks guys. Yes, I used Izy's suggestion, and it worked like a charm

    kind regards,
    Jill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •