Results 1 to 3 of 3
  1. #1
    digitalbalu is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Location
    India
    Posts
    14

    Question How to save a filter in form & re use it in report ?

    In my db there is a customers form(datasheet) & customers report.
    There is a print command button in the form.
    If the End user applies filter & press the print button, only filtered records ( as in the form) should come in report.


    What code should I write? How to save & re use the filter between forms & reports?
    Please help me.. Thanks in advance...

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Options:

    1. Report RecordSource query refers to the controls for filter criteria.

    2. WHERE CONDITION argument of DoCmd.OpenForm (or OpenReport). Code refers to controls for filter criteria. Example:
    DoCmd.OpenReport "report name", , , "customerID=" & Me.tbxCustomerID
    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
    digitalbalu is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Location
    India
    Posts
    14

    Thumbs up

    Thanks June7. I used DoCmd.OpenReport in VBA. Its working...

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

Similar Threads

  1. Wont save my filter
    By mrkaye in forum Access
    Replies: 2
    Last Post: 06-13-2012, 08:30 AM
  2. Filter Report by Field in Form
    By SpdRacerX in forum Reports
    Replies: 3
    Last Post: 02-06-2012, 12:31 PM
  3. Replies: 2
    Last Post: 04-12-2011, 08:33 PM
  4. Replies: 9
    Last Post: 01-20-2011, 02:22 PM
  5. filter by form for report
    By stephenaa5 in forum Reports
    Replies: 1
    Last Post: 05-08-2010, 03:14 AM

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