Results 1 to 5 of 5
  1. #1
    kavya is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2018
    Posts
    10

    Creating a report by passing all the values in a listbox


    I am trying to Create a report by passing all the values in a list box( rather than selected). How can i do this.?

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Usually a listbox has a record source such as a table or query, so why not just base the report record source on the same thing?
    Maybe I'm not understanding...
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    Code:
    if IsNull(lstBox) then
       sWhere = null
    else
      sWhere = ..items in listbox
    endif
    
    docmd.OpenReport "rptname",acViewPreview,,sWhere

  4. #4
    kavya is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2018
    Posts
    10
    I have a list box(Invest) in a form(Review) and i want to generate a report by passing all the values of a list box to the report.
    so, right now whats going on is - The report is generated only for 1 selection in the list box. but i want the report to be generated for all the values(multiple) in the list box.
    Is this possible.?

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    You haven't provided any info that addresses what I already wrote although I will admit to using the wrong terminology - record source instead of row source.
    I repeat; if your listbox has a table or query as its row source, base your report on that. If the source is a value list, then that's an entirely different scenario and you have to inform us about that.

    If you're saying you want to use all the listbox row data (which would be the bound field if there's more than one listbox column) as criteria, that's a different thing again. You either "create" a report manually in design view or you use the report wizard. Creating is one thing. Populating one (assigning it a record source) is another matter. Not sure which it is you're talking about.

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

Similar Threads

  1. Replies: 12
    Last Post: 04-16-2018, 11:31 AM
  2. Passing values to a report from a form in Access 2013
    By InspectorHound in forum Reports
    Replies: 1
    Last Post: 06-17-2015, 02:58 PM
  3. Replies: 21
    Last Post: 06-11-2015, 03:03 PM
  4. Passing Multiple selection values to a report
    By techexpressinc in forum Forms
    Replies: 7
    Last Post: 01-13-2012, 02:27 PM
  5. Replies: 1
    Last Post: 03-24-2010, 08:42 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