Results 1 to 3 of 3
  1. #1
    Tablerone is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    18

    Unhappy Really need help with 2010 Macros

    Hi, I really need people who understand the 2010 Macro Builder and how to use Macros with "After Update" events.

    MACRO BUILDER IS THE ONLY TOOL AVAILABLE IN 2010 WEB DATABASES. Please don't reply with a load of code and say you missed that bit.

    I need to use it (2010 Macros) to create the style of "After Update" events that allow you to build cascade combo boxes. In the past I've done this with a little code, eg the Private Subs on this page:
    http://www.fontstuff.com/access/acctut10.htm



    The idea is (I hope many advanced users should be familiar with it, if not you can probably pick up the idea very easily): Two combo boxes: cboCountry; cboRegion. I select Mexico, After Update event then narrows the choices in cboRegion to the Mexican ones. If I change the record to have Country: Canada, this (via an "After Update" event) updates the contents of cboRegion with Canadian regions only, and pops cboRegion open to remind the user that now they've made a new choice with Country, they'll also need a new selection for Region.

    Now, how to get this job done with Macros (eg in a Web Database where this is the only tool available)? Please tell me even if you think it is obvious.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Haven't done a web database and don't use macros but as I understand them, and I just tested, this should work. Comboboxes are set as single column. The RecordSource for cboRegion needs to be an SQL (or reference to a saved Access query) that has reference to the cboCountry as filter criteria. Then the AfterUpdate for cboCountry is an embedded macro with:

    Action: Requery
    Arguments: cboRegion
    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
    Tablerone is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    18
    Thank you very much.

    At first glance your answered seemed too short. But then I realised that although I had missed it first time Requery was there as one of the Macro options, and this was all I needed really as far as Macros where concerned.

    Then I remembered (because my code really used to be very limited, and even that got very rusty) that the type of code you use in the "Property Sheet" fields (like Row Source) was called SQL code, looked at how a simple VBA code WHERE statement I'd seen elsewhere could be adapted, the SQL style came back to me, and after a couple of rounds of error messages and corrections...

    ... I have my working cascade! Very happy thanks. Much easier than I thought. From where I'm starting Access looks a bit intimidating at times. When you can't do something it seems so frustrating, then once you've done it you almost wonder why you ever had any trouble.

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

Similar Threads

  1. Replies: 17
    Last Post: 08-03-2011, 05:19 PM
  2. Macros
    By kstyles in forum Programming
    Replies: 2
    Last Post: 07-12-2011, 01:38 PM
  3. Macros??
    By Rosier75 in forum Programming
    Replies: 3
    Last Post: 02-01-2011, 01:55 PM
  4. Macros
    By Capri Pruitt in forum Access
    Replies: 1
    Last Post: 09-13-2010, 10:36 PM
  5. VBA or Macros
    By mastromb in forum Forms
    Replies: 6
    Last Post: 01-03-2010, 04:46 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