Results 1 to 4 of 4
  1. #1
    JMR is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    17

    Arrow VBA changes report recordsource but recordsource property box does not show this.

    Hi, I have a sample DB that is a very simple example of a problem I need to solve. A table with color and size. A RED query that filters by red and a BLUE query that filers by blue. A single report has no set record source in design mode.

    When the report it opened, it is opened with a recordsourse of Red set by On Open Vba. Two buttons on the report header are RED and BLUE. When the buttons are pressed they simply execute one line of vba to change the record source.

    The problem is I need the recordsource PORPERTY BOX to be populated with the new recordsource query so that the "Sort By" in the "Group, Sort and Total" section will work.

    I know there are other ways to do this, but this is a VERY simplified example of a more complex DB that needs the RecordSource Property to SHOW the current recordsource.


    I can send you the small sample DB so you can see what this is all about. Too bad it can be uploaded here.


    Can anyone help with this?





    Thanks! jmark@stayintouch.us

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    As answered elsewhere

    I'm not clear where you expect to see the recordsource while the report is open. As I would expect, this shows the blue query as the record source:

    Me.RecordSource = "QueryBlue"
    MsgBox Me.RecordSource
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,858

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

Similar Threads

  1. Replies: 10
    Last Post: 04-08-2019, 04:48 PM
  2. RecordSource Property of a form
    By mkc80 in forum Access
    Replies: 4
    Last Post: 08-11-2012, 05:43 PM
  3. Replies: 0
    Last Post: 05-09-2011, 01:51 PM
  4. Replies: 1
    Last Post: 04-25-2011, 12:20 PM
  5. Changing A Report Recordsource from a form
    By warrenjburns in forum Reports
    Replies: 0
    Last Post: 04-09-2009, 05:38 AM

Tags for this Thread

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