Results 1 to 5 of 5
  1. #1
    mrmims is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Posts
    53

    VBA to Embedded Macro


    Hello,

    I have VBA code to open a report to a record currently open in a form.

    Code:
    DoCmd.OpenReport "rpt_All_Axis_Report"acViewReport, , "AxisNumber=" Me!AxisNumberacDialog 
    The code works great in VBA to open the report to the current record.

    How do I do this in an Access 2010 Macro Builder in the Where Condition? It does not work when I add "AxisNumber=" & Me!AxisNumber to the where condition

    Thank you for your help

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Me is only valid in VBA. You'd need the full form reference:

    http://access.mvps.org/access/forms/frm0031.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Have to ask - why macro if you already have the VBA? Is this now or intended to be a web database?
    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.

  4. #4
    mrmims is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Posts
    53
    Thank you for the replies.

    I'm sorry, but I don't quite understand the link to the webpage about correct syntax.

    And I am trying to modify for a Web Database and get rid of as much VBA as possible

    Thank you

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You could open the expression builder wizard - click the ellipsis/wand at the right end of Where Condition.
    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. Replies: 2
    Last Post: 06-30-2013, 09:59 AM
  2. Embedded Macro not there
    By notacluewhatimdoing in forum Forms
    Replies: 4
    Last Post: 03-23-2013, 08:04 AM
  3. Embedded Macro
    By sireesha in forum Forms
    Replies: 1
    Last Post: 12-08-2012, 02:28 PM
  4. Embedded macro
    By thart21 in forum Forms
    Replies: 1
    Last Post: 06-28-2011, 12:18 PM
  5. Run Embedded Macro
    By smikkelsen in forum Forms
    Replies: 0
    Last Post: 07-07-2010, 09:44 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