Results 1 to 11 of 11
  1. #1
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Run Macro On Open? (Office XP)

    How do I make a macro run upon opening my database? I want (upon open) my WelcomeForm to open.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Run Macro On Open? (Office XP)

    You don't need a macro for that. Select Tools | Startup... In the Startup dialog, you can specify which form (if any) will be displayed when the database is opened, whether the database window will be visible etc.

    Notes:
    - You can bypass these options by keeping the Shift key down while opening the database.
    - You can disable the Shift key as bypass key, see for example <post#=181926>post 181926</post#>.
    - If you want to use a macro instead, name it AutoExec. It will be executed automatically when the database is opened.
    - Again, running AutoExec can be prevented by keeping Shift down, unless this has been disabled.

  3. #3
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run Macro On Open? (Office XP)

    Awesome...thanks! I'm a little confused right now. How do I set a user group so it is unable to view the database window, but able to edit information I select?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Run Macro On Open? (Office XP)

    I'm confused too. What exactly do you mean? Are you speaking about user-level security?

  5. #5
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run Macro On Open? (Office XP)

    Well yes, I have my admin user level set, but 1) how do i create more? Also - I have two tables, my main table (Table 1), and another one (Table 2), both have ssn. I want to allow multiple occurrances of SSN in Table 2, as Table 2 will contain recurring events (scores from competitions...) how do I have to set that up? I'm trying to set up a form where all that is entered is SSN, date, and score (assuming that will create a new record), and then I can create a report saying who hasn't competed, as well as all previous competition scores. I'd also like to export that info as excel, so I don't have to PRINT the grouped report....
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Run Macro On Open? (Office XP)

    That's a lot of questions in a few lines!

    - You really should study the documents referred to in <post#=432371>post 432371</post#>. The first link in WendellB's tutorial, ACC2000: Microsoft Access Security FAQ Available in Download Center is very useful, it explains a lot of details about setting up security.

    - You want a one-to-many relationship between Table1 and Table2 on the SSN field. This implies that SSN is the primary key in Table1, but not in Table2. To learn more about the types of relationships between tables, study a good book about database design (for example Access Database Design and Programming by Steven Roman). In the meantime, you can download a short paper by Microsoft from "Understanding Relational Database Design" document is available in Download Center.

    - You can export tables, queries, ... to Excel.

  7. #7
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run Macro On Open? (Office XP)

    A lot of the security I've figured out....I just realized I needed the One - To - Many relationship, but forgot that I'd set the SSN as the primary key in Table 2. My primary key is only in table 1, but when i try to enter a ssn again in the form to add another instance, it won't let me....
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Run Macro On Open? (Office XP)

    What is the Record Source of the form? What is the exact error message you get?

  9. #9
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run Macro On Open? (Office XP)

    -Edit- I GOT IT!!! Ok, done with the victory dance, thanks for the help Hans!
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  10. #10
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Run Macro On Open? (Office XP)

    If you figured it out, the generous thing to do is to post the solution so that others can benefit from it. Please share it with us.
    Charlotte

  11. #11
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run Macro On Open? (Office XP)

    Yikes! Sorry, it was a simple error though....all I was doing was using the wrong linked field in my form....I needed to use the linked field from my secondary table, the one I want to allow multiple occurrances in.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

Posting Permissions

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