Results 1 to 4 of 4
  1. #1
    Janeski is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2015
    Location
    Barrow-in-Furness
    Posts
    1

    Choosing fields to display in a report using parameters

    I have a table of projects (rows) with monthly workload in columns e.g. 2015-06, 2015-07, etc. Each time I run the report, I only want to include fields for the current month and the following 5 months i.e. 2015-06 to 2015-11. I have got as far as asking for the parameters 'Current Year' and 'Current Month', but I don't know how then to apply these parameter values to select the appropriate field as the starting point e.g. 'Current Year' = 2015 and 'Current Month' = 06, so select field '2015-06' and then select the next field using 'Current Month' + 1 e.g. 2015-07, etc.?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550

    dynamic report for crosstab qrys

    You cant really make reports using crosstabs because of the changing columns.
    The EASIEST way is take the exisiting report ,saveAs , then modify it to the new query.
    but I made an attempt to make a fluid, self correcting report via code.
    Since its advanced code, it may be of no use to you, but you can look.
    dynamicHdrDb.zip

  3. #3
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    query criteria : Between [Start Date] And [End Date]
    have your year-month be entered as one field

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Is this a CROSSTAB query? Creating a stable report to run perpetually based on crosstab is not easy but is doable. Review http://allenbrowne.com/ser-67.html

    If you are actually working with a non-normalized table structure, then a report with dynamic fields would be even more complicated. Instead of a table with field for each fiscal year data, should be a field for the data and another field for the year identifier (or calc the fiscal year in a query using a record date field). Then use that table/query as source for a CROSSTAB query with filter parameters on the year identifier field.
    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. Replies: 1
    Last Post: 06-06-2014, 08:26 AM
  2. Choosing Report
    By ShadeRF in forum Reports
    Replies: 12
    Last Post: 11-18-2011, 11:31 AM
  3. Replies: 1
    Last Post: 11-13-2011, 08:01 AM
  4. Union Query (choosing between two fields)
    By naveehgreen in forum Programming
    Replies: 1
    Last Post: 06-17-2010, 03:24 PM
  5. DISPLAY INPUT PARAMETERS ON THE REPORT
    By fadone in forum Forms
    Replies: 1
    Last Post: 12-09-2005, 10:26 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