Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Posts
    154

    Question Unanswered: Setting X-Axis Maximum date For Line Chart

    Does anyone out there know how to set the maximum date for a chart object bound to a query in Microsoft Access 2003? What I mean is my boss wants the graph ticks to go to the end of the year and whereas it is simple to do this by clicking on the chart object, it would be much nicer if I could programmatically set the maximum scale of the X-axis to 12/31/Current Year. Using code like this just jacks up the Y axis:

    Private Sub Report_Activate()
    Dim objChart As Object
    Dim dteEnd As Date
    Dim intYear As Integer

    intYear = DatePart("yyyy", Now())
    dteEnd = "12/31/" & intYear
    Set objChart = Me!gphOpen.Object
    objChart.Axes(2).MaximumScale = dteEnd

    End Sub

    Anyone have an idea how to make it affect the X-axis instead? I thank you in advance for your time and your responses.

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    Re

    Quote Originally Posted by feetdontfailme
    Using code like this just jacks up the Y axis:

    objChart.Axes(2).MaximumScale = dteEnd

    End Sub

    Anyone have an idea how to make it affect the X-axis instead? I thank you in advance for your time and your responses.
    Should it not be : objChart.Axes(1)
    if axes(2) Influences your Y axis then 1 should Influences your X axis

    Or add it to your Storedporc/SQL as an extra row
    Greetz Marvels -^.^-
    Developments : VB4 Through .Net; Basic; DOS ; CNC ; Sinclair
    Databases : SQL Server Through 2005; Access 3 Through 2003 ; Oracle 8 & 9.i ;
    OS : Win 3.11 Through XP ; NortonComander ; DOS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •