INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Access Report Graph/Chart Set Maximum Value of X Axis and Scale of X Axis

Access Report Graph/Chart Set Maximum Value of X Axis and Scale of X Axis

Access Report Graph/Chart Set Maximum Value of X Axis and Scale of X Axis

(OP)
Hi, I have been searching and can't seem to get this working.
I have a ms access bar graph which has a list of tasks on the y axis. The x axis shows the percentage completed of each task (value between 0-100)
I'm trying to set the maximum value of the x axis to display 100 and the scale in increments of 10 (as its a percentage it will never be greater than 100).
As per the attached file it if there isn't a task which isn't 100% complete the scale doesn't go all the way to 100.
I have been trying to set it via vba
Me!graphDesignProgress.Axes(1).MaximumScale = 100
But keep getting an error message so I think I'm on the wrong track
If the solution can be done with vba what code should I be using and where do I call the code from, is it the chart 'On Updated' event?
Any advice appreciated
Thanks
Justin

RE: Access Report Graph/Chart Set Maximum Value of X Axis and Scale of X Axis

hi,

Use a Percent Bar Chart type.

RE: Access Report Graph/Chart Set Maximum Value of X Axis and Scale of X Axis

(OP)
Thanks for the reply. I ended up going with a different solution which gave me a bit of extra control over the grouping and appearance of the chart. I just created a continuous report with a textbox to show each task. Next to this I have 100 small textboxes called (box1 to box100) and in the on open event I just call the following to set conditional formatting for each textbox. This gives me a bar graph for each task reflecting the percentage complete, the bonus is I have grouping on the report to group tasks under their respective categories. Pretty happy with the outcome.

Private Sub Report_Open(Cancel As Integer)
On Error GoTo HandleError
Const mdlConstBlue = 16748574
Dim objFrc As FormatCondition
Dim intCount As Integer
intCount = 1
Do While intCount < 101
'REMOVE FORMAT CONDITIONS FOR BOX
Me.Controls("box" & intCount).FormatConditions.Delete
' Create three format objects and add them to the FormatConditions
Set objFrc = Me.Controls("box" & intCount).FormatConditions.add(acExpression, , "[fldNZPercentComplete]>=" & intCount)
With Me.Controls("box" & intCount).FormatConditions(0)
.BackColor = mdlConstBlue
End With
intCount = intCount + 1
Loop

Exit_HandleError:
Exit Sub

HandleError:
'Resume Next
Resume Exit_HandleError

End Sub

RE: Access Report Graph/Chart Set Maximum Value of X Axis and Scale of X Axis

I would simply use a little code in the On Format event of the detail section to set the Width of a text box. Set the fill of the text box to the appropriate color and align the text where ever you want.

CODE --> vba

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Dim int100Pct As Integer  ' width of 100 Percent
    int100Pct = 1440 * 6      ' 6 inches
    Me.PercentCompleted.Width = Me.PercentCompleted / 100 * int100Pct
End Sub 

Duane
Hook'D on Access
MS Access MVP

RE: Access Report Graph/Chart Set Maximum Value of X Axis and Scale of X Axis

(OP)
Thanks Duane, I knew there was going to be an easier solution but its up and running now so I'll leave it as is:) If I have to alter the width of the chart I'll take up your solution rather than adjusting my 100 separate textboxes.

Thanks
Justin

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close