Results 1 to 8 of 8
  1. #1
    PhatRam32 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    11

    Auto-Runing a button on an ms access form


    I am trying to auto run two buttons I have on my Form when it loads upon opening the database.

    Here is what I have tried so far without much luck (did not run anything). Any help would be greatly appreciated.

    Items to note:

    cmdRun and cmdExport's Subs are all set to public.

    Private Sub Form_Load()

    CmdRun_Click
    CmdExport_Click

    End Sub

    other try:


    Private Sub Form_Load()

    Call cmdRun_Click
    Call CmdExport_Click

    End Sub

  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,772
    Both Load and Open events work for me.

    Step debug. Refer to link at bottom of my post for debugging guidelines.
    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
    PhatRam32 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    11
    Just tried using the Open Event of the form and it did not work =/.

  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,772
    Must be issue with code in the click events.

    Debug as suggested.
    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
    PhatRam32 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    11
    I will debug and see what I find and report back

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by June7 View Post
    ...Must be issue with code in the click events...
    Having no problem making this code work, either, I'd have to agree that it must be something in the code behind the Command Buttons.

    But just to make sure that we're not on a snipe hunt, here...do you have any VBA code in this database that works?

    Linq ;0)>

  7. #7
    PhatRam32 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    11
    Yes the vba code behind the two buttons work like a charm. I will take a closer look though and see if there is something that is interrupting this process.

  8. #8
    PhatRam32 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    11
    I figured it out... My Macro settings for some reason got disabled.. which prevented me from running any VBA macros. The code I had posted earlier now works... silly mistake however, I appreciate the assistance.

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

Similar Threads

  1. Access 2010-runing old files
    By gg80 in forum Access
    Replies: 4
    Last Post: 01-09-2014, 09:57 AM
  2. Replies: 5
    Last Post: 04-20-2013, 11:32 AM
  3. Runing a report from combobox
    By frksdf in forum Programming
    Replies: 2
    Last Post: 09-13-2011, 09:01 PM
  4. Runing a quey in the back end?
    By jbr87 in forum Access
    Replies: 7
    Last Post: 07-25-2011, 08:30 AM
  5. Runing Moduels from Macro's - Access 2003
    By damo1995 in forum Access
    Replies: 7
    Last Post: 02-10-2011, 03:40 AM

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