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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Box Grow according to dates 2

Status
Not open for further replies.

Mr2006

Technical User
Jun 21, 2006
80
US
I have been working oin this report for a while. It works now butI need the following codes to make the box grow to match the start date and end date. right now, it grows according the number of days. Instead, I want the trip total days to show in the timeline showing startdate and end date in each timeline.

Any help will be great.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim intStartDayDiff As Integer
Dim intDayDiff As Integer
Dim sngFactor As Single

On Error Resume Next

Me.ScaleMode = 1 'Twips
sngFactor = Me.boxMaxDays.Width / mintDayDiff

If Not IsNull(Me.ProjectSubDate) And Not IsNull(Me.ProjectSubEnddate) Then
Me.boxGrowForDate.Visible = True
Me.lblTotalDays.Visible = True
intStartDayDiff = Abs(DateDiff("d", Me.ProjectSubDate, mdatEarliest))
intDayDiff = Abs(DateDiff("d", Me.ProjectSubEnddate, Me.ProjectSubDate))

If intStartDayDiff = 0 Then intStartDayDiff = 1
With Me.boxGrowForDate
.Left = Me.boxMaxDays.Left + (intStartDayDiff * sngFactor)
.Width = intDayDiff * sngFactor
End With
Me.lblTotalDays.Left = Me.boxGrowForDate.Left
Me.lblTotalDays.Caption = intDayDiff & " Day(s)"
Else '
Me.boxGrowForDate.Visible = False
Me.lblTotalDays.Visible = False
End If
End Sub
 
At-A-Glance", I assume this bit of code is intended to format a control (object / box) to represent an element of a Gantt chart. If (and only IF) this is true (or reasonably close), there are (working) examples of this about. Please do a search on Gantt Chart and follow the trail.




MichaelRed


 
Yes. It is. The bove codes serve as a timline. I looked in the web and did not see anything for access.
 
I did not see what I want exactly since my report will need to have the following fields:

Project name, start date, end date and decription. after that the graph on the right habdside. something similar to the following link

BTW wow...man. I looked at the site and the samples.. you are good. I hope one day I can be like you.....
 
[qoute MR2006]" ... I did not see what I want exactly ... "[/quote]

In the 'best' sense of these fora (at least from my perspective) are not to provide custom soloutions to specific users (e.g. SAME field names, control names, code structures, etc.) but to help those who are interested in improving their craft by learning. My experience renforces the adage "We learn by doing", so Mr. Hookom's example can (should?) be used ae a pattern for you to see how it works and adapt your system to that model - thereby exercising the axiom.

BTW, his example is easily worth a star.




MichaelRed


 
I think most of the reponse I get from here deserve a star and I am truly very well aware that you do not offer custom soloutions and I do not expect it. Otherwise, I am not learning anything.

When I said that I did not see what I want exactly, I meant that I did not see anything that can be close to match my need.

Again, I will look again.

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top