Results 1 to 3 of 3
  1. #1
    Mwhiterabbbit is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    8

    Date from Query Into Chart Axis Label

    Hello,



    I built a nice chart to count the number forms made by each of our 3 shifts based upon a time frame. However, I cannot find out how to show the date range on the chart.

    The query has two sections
    It has the date field with criteria
    Code:
    Between [Enter the start date:] And [Enter the end date:]
    and the Shift field that only contains A,B, or C.

    The chart row source line is this
    Code:
    SELECT shiftdate.shift, Count(shiftdate.Date) AS CountOfDate FROM shiftdate GROUP BY shiftdate.shift;
    If I was to select a date from 1/1/14 to 7/2/14 how do I show this on the chart when I run the report?

    Thank you for your help
    Last edited by June7; 07-03-2014 at 12:56 PM.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Are you asking how you show each day in that date range regardless of whether there is any activity or not? or are you just asking how you show the shiftdate on the X axis of a line/bar graph?

    Or are you asking how do you add a label to your chart showing the date range it was run for?

    If it's the latter, you can add two fields to your query

    StartDate: [Enter the start date:]
    EndDate: [Enter the end date:]

    Then base your report on the query as well as the chart and put a text box on the report with the formula

    ="Report run for dates between " & [StartDate] & " and " & [EndDate]

    actually putting the label on the chart (with chart controls) I don't think can be done (I've never tried but the charting object in ms access is very limited)

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    It is possible to use code to set content of chart labels (title, axis) but is more complicated than rpeare's suggestion for a textbox on report. Example from my code to set Y axis label.

    If Me!Metric = True Then
    Me.gphWeight.Axes(xlValue, xlPrimary).AxisTitle.Text = "Unit Weight, kg/cu.cm"
    Me.gphGradation.Axes(xlCategory, xlPrimary).AxisTitle.Text = "Sieve Size (mm)"
    Me.gphITSdry.Axes(xlValue, xlPrimary).AxisTitle.Text = "ITS Dry, kg/cu.cm"
    Me.gphITSsoak.Axes(xlValue, xlPrimary).AxisTitle.Text = "ITS Soaked, kg/cu.cm"
    End If

    Sorry, don't have any for chart title or X axis. But I think the X axis is xlCategory instead of xlPrimary.
    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: 13
    Last Post: 06-10-2014, 06:19 AM
  2. Formatting Chart Axis
    By kab16 in forum Access
    Replies: 2
    Last Post: 06-05-2014, 11:13 AM
  3. Scaling a Chart Axis
    By Paul H in forum Reports
    Replies: 5
    Last Post: 10-16-2013, 01:50 PM
  4. Y Axis Scale Problem on XY Scatter Chart
    By Paul H in forum Access
    Replies: 1
    Last Post: 01-15-2013, 06:14 PM
  5. Chart axis change with .Chartype changes
    By alangea in forum Programming
    Replies: 2
    Last Post: 05-20-2012, 12:41 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