Results 1 to 5 of 5
  1. #1
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    237

    Passing data to a report using OpenArgs

    Hi to all,
    I have a main form and a subForm. The main form have several text boxes and combo boxes. The user type values in some of these text Boxes and/or combo boxes. A search button is on the main form; clicking it will build a WHERE clause (strWhere) for the search criteria and displayed the records in the subForm.
    A second button on the main form opens a report to print these records fulfilling the criteria. Records are shown on the subform.


    How to pass the strWhere value using OpenArgs to the report so the user may see the search criteria he used on the main form?

    Khalil

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,858
    OpenArgs would hold the criteria?
    I am puzzled by this question? Have you looked at the OpenReport command? https://docs.microsoft.com/en-us/off...cmd.openreport
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Just pass strwhere in the openargs parameter of openreport and in the report open event assign openargs to an appropriate control called say txtwhere

    Me.txtwhere=openargs

    Not tested but pretty sure

    Me.txtwhere=me.filter

    Will work as well

  4. #4
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    237
    Hi,
    I checked the link provided and found what I was looking for.
    Thank you All.

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,858
    Quote Originally Posted by Khalil Handal View Post
    Hi,
    I checked the link provided and found what I was looking for.
    Thank you All.
    My first point of call..... Google
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. OpenArgs - Passing a Prefixed Auto Number
    By Steven19 in forum Programming
    Replies: 1
    Last Post: 02-17-2022, 08:48 AM
  2. Replies: 33
    Last Post: 09-22-2020, 04:37 PM
  3. Replies: 14
    Last Post: 05-26-2015, 04:30 AM
  4. Replies: 5
    Last Post: 01-27-2013, 06:04 PM
  5. How to set openargs of sub report?
    By flippedbeyond in forum Programming
    Replies: 11
    Last Post: 09-20-2011, 08:24 PM

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