Results 1 to 5 of 5
  1. #1
    WickidWe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    123

    Run a VBA script When a form opens

    Hi,

    I know it will be a simple answer but how do I set a VBA script on a form opening?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Code in the form Load, Open, or Current event.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    WickidWe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    123
    Perfect Thanks

    One more thing off topic
    I want a button to Run a specific report then print
    can you help? or should I just make a new thread?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    DoCmd.OpenReport "report name here"

    will send direct to printer.

    Access VBA Help has more info on using OpenReport (or OpenForm) and its arguments.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    WickidWe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    123
    Thank you

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 21
    Last Post: 08-05-2013, 06:23 AM
  2. Read form info, pass to VB script... lost
    By enragedcow in forum Forms
    Replies: 4
    Last Post: 08-28-2012, 01:11 PM
  3. Replies: 35
    Last Post: 12-21-2011, 02:16 PM
  4. Replies: 1
    Last Post: 03-07-2011, 10:48 AM
  5. Form opens for only seconds
    By MFS in forum Programming
    Replies: 5
    Last Post: 11-04-2010, 09:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums