Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data bars in Access 2007 reporting

Status
Not open for further replies.

paullem

Programmer
Jan 21, 2005
80
GB
Hi, I am trying to duplicate the layout of an existing Excel 2007 spreadsheet in an Access 2007 report. The spreadsheet contains Data Bars which I can find reference to in Access 2010 reporting but not in Access 2007. Have I just missed it or are they only available in Access 2010? If this is the case does anyone know how to duplicate the same facility in Access 2007 reporting. I think the other option will be to export the data into a template of the spreadsheet but I am not sure how to go about doing this?

Many thanks for any help/suggestions.
 
This somewhat depends on what exactly you mean by "data bars". If you want a filled rectangle with a length based on a numeric value, you could try something like:
1) name the text box bound to the value "txtTheValue"
2) add a text box to the Report Header section with a control source of
=Max([YourValueField])
3) add a rectangle to your detail section and name it "DataBar"
4) add code like:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Dim dblMaxLength As Double
    dblMaxLength = 2880 '2 inches
    Me.DataBar.Width = (Me.txtTheValue / Me.txtMaxValue) * dblMaxLength
End Sub

Duane
Hook'D on Access
MS Access MVP
 
Thanks for that suggestion, I'll give it a try.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top