Results 1 to 4 of 4
  1. #1
    Coltom is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jun 2016
    Posts
    2

    Refreshing a report to show new filtered query?

    Come with experience from another well known relational database application but an Access virgin so please be patient!

    I have designed labels based on a query. However, if I filter the query to select a subset of records then reopen the report the labels only list all the records from the base table. Thinking a 'refresh' might simply be required to reset all the relationships I tried the 'Refresh All' button but this doesn't change the labels report to show the updated, filtered query. However, if I show the report properties in design view, choose another query based on the same table and then go back and simply choose the correct, now filtered query as the record source the filters are reset appropriately and the labels update successfully. Although this action works it doesn't seem right. Why doesn't 'Refresh All' apply the new query filter to the opened report? What should I be doing?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Docmd.openreport "rptName",,filter

  3. #3
    Coltom is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jun 2016
    Posts
    2
    Thanks. Almost there I think. So I -
    - opened the report ("Labels") in Design View
    - clicked into Events tab
    - clicked on 'On Open' row
    - clicked on 'Code Builder in the Choose Builder dialogue, clicked OK, and code is -
    - Private Sub Report_Open(Cancel As Integer)

    DoCmd.OpenReport "Labels", , Filter

    End Sub

    - saved, closed report
    - opened query Customer (in Datasheet view) on which Labels is based, did some filtering, saved query
    - clicked Labels but get Run-time error '2585'
    - debugging highlights the 'DoCmd.OpenReport "Labels", , Filter' line

    I am reading books, googling, etc etc about this but would really appreciate a little more help if poss?

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

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

Similar Threads

  1. Replies: 2
    Last Post: 12-13-2014, 08:52 PM
  2. Filtered Report from filtered datasheet form
    By gemadan96 in forum Reports
    Replies: 7
    Last Post: 01-03-2014, 05:12 PM
  3. Replies: 7
    Last Post: 11-13-2012, 01:44 PM
  4. Replies: 3
    Last Post: 11-06-2012, 03:25 PM
  5. Report based on Query but filtered by form
    By michel_annie22 in forum Reports
    Replies: 1
    Last Post: 10-23-2012, 10:40 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