Results 1 to 4 of 4
  1. #1
    orangeman2003 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    21

    Access VBA and Macros

    Hi,

    I am extremely elementary at VBA and I'm not sure I need it here but I'm stuck and could use help. Basically I have a form that has a bunch of checkboxes. I have had success with assigned or rather 'embedding' macros in a checkbox. I don't like this because every time the user clicks the box an action occurs rather than all at once. Basically I want to have a button that says something like 'execute' where let's say I have 10 check boxes and 4 of them are checked or true. when I click that button I want all the macros for those selections to run. However, because most of my macros are embedded within each checkbox I cannot figure out how to call them by name.


    something like... IF checkbox is true then execute embedded macro for checkboxes x, y, z, etc., but do nothing for a box that is NOT checked.



    Thanks!

  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
    Don't have individual macros. Put all code into the button macro.

    I don't use macros, only VBA.
    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
    orangeman2003 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    21
    I'm not advanced enough to do that. Basically I have to create a macro, convert it to VBA (this part isn't hard) but then the hard part is putting into a sequence of code that works.

  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
    If you want VBA why do you have embedded macros?

    The button click code could be like:

    If Me.check1 Then
    'do this
    End If

    If Me.check2 Then
    'do this
    End If

    etc.
    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.

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

Similar Threads

  1. Access 2010 Macros
    By jdftwrth98 in forum Programming
    Replies: 1
    Last Post: 07-01-2012, 12:11 PM
  2. Run Excel Macros in Access
    By jo15765 in forum Programming
    Replies: 8
    Last Post: 10-13-2011, 01:20 PM
  3. Macros in Access
    By King in forum Access
    Replies: 1
    Last Post: 09-22-2011, 05:54 PM
  4. Using Excel macros in Access
    By Lorlai in forum Programming
    Replies: 2
    Last Post: 06-03-2011, 02:01 PM
  5. Access macros
    By mamig in forum Access
    Replies: 2
    Last Post: 01-09-2010, 11:26 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