Results 1 to 6 of 6
  1. #1
    Radtastic10 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    65

    Subreport Possibilities

    I am curious to the limitations of a subreport. I have a report with 4 or 5 subreports. One of the subreports in particular pulls data from a table where the data is very similar. However, there is also different classifications within the table so some of the data is different if you compare the different classifications. My question is it possible to have the information displayed on the report change with the classification? So if there is multiple entries that are being shown on the subreport the appropriate information will be displayed automatically.



    The combinations of how the information is recorded is always changing. So I am looking for a dynamic way to allow for that. Cause making a new report for every combination would just become cumbersome and pointless.

    I am not able to post a copy of the DB or report. However, I am trying to figure out a way to make a mock DB to represent what I am trying to do.

    I have a feeling this will involve quite a bit of VBA coding if it is possible. But either way I am just trying to figure out if it is indeed possible, and if so what is the proper direction to start heading.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Not really sure what you're asking,
    but if you make a form,and put controls on it, your report can use the data criteria using this form.
    this way you don't need a different report for different data.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    if you are happy for your subreports to be in datasheet view then you can do the following.

    1. create a form in datasheetview based on a table our query - i.e. click on a table or query then click on Create>More Forms>Datasheet. Save the resultant form as say 'FlexForm'

    2. In report design, drag this form onto the report. - Assume the sub control is called subFlexForm.

    3. You then need some simple code (suggest create a button on the report for now and use the click event for testing) as follows:
    Code:
    me.subFlexForm.SourceObject="Query.AnotherQuery"
    Where AnotherQuery is the name of another query

    if you want o have a table, the use "Table.AnotherTable"

    You can still use the linkChild and LinkMaster properties - for filtering purposes - just may need to change names if required


    Note you need to use a form as the sub report since reports do not themselves have a datasheet view

  4. #4
    Radtastic10 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    65
    Unfortunately this solution won't work for what is wanted.

    I still am unable to construct an example DB to post. But here is a simplified version of what I am looking to do.

    tblVehicles
    Classifications: Trucks and Cars
    gas mileage, towing capacity, number of seats, engine size, ... etc

    What I am looking for this subreport to do is look at the information that is being queried for a particular set of records (input by the user), and then based on whether it is a truck or car display the relevant information.

    So if it is a truck it would display the gas mileage, the towing capacity, engine size, bed size, and so on.
    Likewise if it is a car, it would display gas mileage, engine size, number of seats, maybe safety rating and so on.

    Like I said there will be a couple of fields that are used no matter what but the majority will change depending on the classification of the record being displayed.

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Well, it is the only suggestion I can make - the only variation is to create a form for each view that you require and modify the code in step 3 to be the name of the form

  6. #6
    Radtastic10 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    65
    Fair enough. Like I said initially I wasn't sure if what I am trying to do is even possible. But I appreciate the suggestion never the less.

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

Similar Threads

  1. Replies: 2
    Last Post: 03-09-2015, 01:06 PM
  2. Replies: 7
    Last Post: 11-23-2013, 02:20 PM
  3. Replies: 1
    Last Post: 04-15-2013, 10:02 AM
  4. Access 2010, add-ons and active-x, Possibilities?
    By justphilip2003 in forum Access
    Replies: 1
    Last Post: 04-05-2013, 03:34 PM
  5. Replies: 3
    Last Post: 08-16-2011, 11:04 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