Results 1 to 5 of 5
  1. #1
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Sep 2013
    Posts
    287

    "clicking" 2 buttons on another open form, via vba


    Hey guys,

    I have 2 open forms. The active one has a button that runs a sub. The sub calculates 2 dates. The 2 dates are then pushed to the inactive form. This works perfectly. Next I need to "click" 2 of the buttons on that inactive form. Those 2 buttons have relatively large subs.

    I have read that this can be accomplished via Form_frmName.SubName() but that is throwing an "expected =" error.

    Any help would be appreciated!

    Thanks!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    That's because it thinks that is a function. Try:

    Call Form_frmName.SubName

    Make sure the event is not declared Private.
    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
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Sep 2013
    Posts
    287
    One more snag, the form name has a space (I didn't design this one..) , what is the proper way to bracket or quote it?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    This also works:

    Call Forms("form name").SubName
    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
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Sep 2013
    Posts
    287
    Perfect. Working great. Appreciate all the help!

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

Similar Threads

  1. Replies: 3
    Last Post: 02-06-2015, 03:22 PM
  2. Replies: 1
    Last Post: 09-03-2014, 03:27 AM
  3. Replies: 2
    Last Post: 01-15-2014, 07:57 PM
  4. Replies: 2
    Last Post: 05-27-2013, 09:57 AM
  5. Replies: 2
    Last Post: 10-12-2010, 12:02 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