Results 1 to 5 of 5
  1. #1
    Frasier433 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    3

    Report from a Crosstab query column heading problem....Very frustrating!!!


    My report is not working because of the crosstab query column headings. The crosstab query pulls the last three months of data. It labels the column headings as the date. When I update the crosstab query and try to run the report it is looking for column headings that are no longer there (it drops a month each month I run the report). How can I get the report to update automatically to only include the column headings available in the crosstab query instead of looking for the original ones that the report was designed on?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    This is always an issue when basing reports on crosstab queries. Crosstab headings are often so dynamic, especially when dates are involved. Stabilizing the report to run perpetually without edits can be difficult. I count myself lucky I don't need any reports based on crosstabs.

    A VBA procedure could modify and save the report to reflect the changed fieldnames of the crosstab. I have some idea of what the code would be like but have never written or seen any such code.
    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
    Frasier433 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    3
    I finally got it. No VBA required. For the column date headings I just put in:

    ColHead: "M" & DateDiff("m",[Over/Under Monthly]![Date],Date())

    Which relabels my columns to be M0, M1, M2, M3,.....Mx.

    Those columns are now dynamic and update automatically so that each month, M0 is the current month, M1 is the previous month, M2 is the previous-previous, etc. This allowed me to run the report and always pull the data from column heading that now never changes.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    Congratulations on finding solution. After seeing your post I do recall helping someone do something like this, but was quite some time ago. Sorry the idea did not come to top of my head, but I did feel it tickle while I read your original post. However, I bet it feels good to get it yourself!
    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.

  5. #5
    Frasier433 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    3
    I can't really say that I did it on my own. Just happened to get some inspiration from something I found on google. Thank you for the input!

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

Similar Threads

  1. Replies: 3
    Last Post: 02-21-2012, 10:15 AM
  2. Replies: 20
    Last Post: 02-14-2011, 10:55 AM
  3. Please help , frustrating problem .
    By bahmadi in forum Access
    Replies: 5
    Last Post: 01-16-2011, 07:45 PM
  4. Problem with cross tab on column heading
    By pascal_22 in forum Queries
    Replies: 0
    Last Post: 12-01-2010, 08:00 AM
  5. Populating list box with column heading?
    By kawi6rr in forum Programming
    Replies: 1
    Last Post: 08-13-2010, 12:51 PM

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