Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2022
    Posts
    3

    Pushing filtered data from a form into a report (preview)

    Rookie who messes with Access to help manage data.....but is at a little loss on how to do a couple simple things...this is one....

    Never had a class, but I've managed to build some forms/subforms where I actively use a variety of means to sort and select data. Instead of "printing" the form or the subform, I've created a report (that looks nicer than the form). How can I send the filtered results from the form to a report?

    Background: I use a couple forms to select the "case" I want where the case number is [OID]. Once I'm in the "case" through a variety of means, I select the data in that case using a variety of selects, including right-clicking on a field and doing things like Select if contains the number 4. Once I get the data on the form (it's a subform) that I want to print, how do I easily get it into the report?

    In this form, I used the variable "stLinkFilter" to selects data based on "a case". When I run it without the "me.filter" I get all the data in the case. When I run it without "me.filter" I still get all the data in the case regardless of what's contained in the list in the subform? How can I just get the data I've selected in the form?

    DoCmd.OpenReport "reportname", acViewPreview, , stLinkFilter, , me.filter

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    What do you mean by you select the data for form by a variety of selects - comboboxes? Are controls UNBOUND and used just to select filter criteria? Is this criteria applied to form?

    stLinkFilter should apply filter to report. What is content? Me.filter does nothing and makes no sense in that argument position. Possibly could use Me.Filter in place of stLinkFilter.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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
    Join Date
    Jan 2022
    Posts
    3
    Thank you for responding. The file is 354MB after compacting so attaching it is probably not viable.

    How can I save the current set of data into stLinkCriteria so that my report uses the same data as the form? My wife is calling me to dinner, I can write more later if that's helpful.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You could make a database that has only the objects needed for the issue and only a few records.

    The attached tutorial can probably explain building criteria better than I can in post http://allenbrowne.com/ser-62.html
    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. Filtered Report from filtered datasheet form
    By gemadan96 in forum Reports
    Replies: 7
    Last Post: 01-03-2014, 05:12 PM
  2. Replies: 1
    Last Post: 02-23-2013, 12:30 AM
  3. Replies: 4
    Last Post: 05-17-2012, 12:28 AM
  4. Pushing Data From one form to another
    By zipmaster07 in forum Forms
    Replies: 21
    Last Post: 02-03-2012, 10:30 AM
  5. Report based of filtered data from a form
    By Fabdav in forum Reports
    Replies: 1
    Last Post: 09-15-2011, 05:28 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