GAntt Timeline

M

margaret

I'm looking for instructions on how to do a Gantt Timeline. I've gone to
this suggested website ...
http://www.invisibleinc.com/divFiles.cfm?divDivID=4 ... but the link doesn't
work. Then I went here ...http://mvps.org/access/reports/rpt0018.htm and
downloaded the files, but when I go to open the database, it tells me I must
install the database on my computer . Exact phrase: File is located on an
intranet or untrusted site. Not so, opening it from the C: drive.

So I'm still looking, any help would be appreciated.

Margaret
 
D

Duane Hookom

The invisibleinc file is now located at
http://www.access.hookom.net/Samples.htm. Most files you download from the
intranet have a property set that you need to change so you can open them.
After downloading, right-click the file and choose Properties. I think the
property is like "unblock".
 
M

margaret

Great ... both the new link and the "unblock" worked so now I can attempt it.
Thanks so much for your help.
 
D

Duane Hookom

Glad to hear you got this working. Come back if you have questions since you
have the attention of the author ;-)
 
M

margaret

I have the following code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim lngDuration As Long 'hours of work
Dim lngStart As Long 'start hour of tour
Dim lngLMarg As Long
Dim dblFactor As Double
'put a line control in your page header that starts 12:00 and goes to
23:00
lngLMarg = Me.boxTimeLine.Left
dblFactor = Me.boxTimeLine.Width / 24
lngStart = DateDiff("h", #12:00:00 AM#, Me.[start])
lngDuration = DateDiff("h", Me.[start], Me.[end])
'set the color of the bar based on a data value
Me.txtName.Width = 10 'avoid the positioning error
Me.txtName.Left = (lngStart * dblFactor) + lngLMarg
Me.txtName.Width = (lngDuration * dblFactor)
Me.MoveLayout = True
End Sub

However, I have some employees who start or end on the half hour and this
places them on the full hour. How do I go about changing it so the timeline
will reflect 1/2 hours?
 
D

Duane Hookom

I think you need to change

Dim lngDuration As Long 'hours of work

lngDuration = DateDiff("h", Me.[start], Me.[end])
to
Dim lngDuration As Double 'hours of work

lngDuration = DateDiff("n", Me.[start], Me.[end])/60

--
Duane Hookom
Microsoft Access MVP


margaret said:
I have the following code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim lngDuration As Long 'hours of work
Dim lngStart As Long 'start hour of tour
Dim lngLMarg As Long
Dim dblFactor As Double
'put a line control in your page header that starts 12:00 and goes to
23:00
lngLMarg = Me.boxTimeLine.Left
dblFactor = Me.boxTimeLine.Width / 24
lngStart = DateDiff("h", #12:00:00 AM#, Me.[start])
lngDuration = DateDiff("h", Me.[start], Me.[end])
'set the color of the bar based on a data value
Me.txtName.Width = 10 'avoid the positioning error
Me.txtName.Left = (lngStart * dblFactor) + lngLMarg
Me.txtName.Width = (lngDuration * dblFactor)
Me.MoveLayout = True
End Sub

However, I have some employees who start or end on the half hour and this
places them on the full hour. How do I go about changing it so the timeline
will reflect 1/2 hours?

Duane Hookom said:
Glad to hear you got this working. Come back if you have questions since you
have the attention of the author ;-)
 
M

margaret

Worked like a champ. But if you don't mind two questions:

1. difference between "long" and "double"
2. why the change between the "h" and "n"

Thanks for your help. I just don't want to put code in that I don't totally
understand.

Duane Hookom said:
I think you need to change

Dim lngDuration As Long 'hours of work

lngDuration = DateDiff("h", Me.[start], Me.[end])
to
Dim lngDuration As Double 'hours of work

lngDuration = DateDiff("n", Me.[start], Me.[end])/60

--
Duane Hookom
Microsoft Access MVP


margaret said:
I have the following code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim lngDuration As Long 'hours of work
Dim lngStart As Long 'start hour of tour
Dim lngLMarg As Long
Dim dblFactor As Double
'put a line control in your page header that starts 12:00 and goes to
23:00
lngLMarg = Me.boxTimeLine.Left
dblFactor = Me.boxTimeLine.Width / 24
lngStart = DateDiff("h", #12:00:00 AM#, Me.[start])
lngDuration = DateDiff("h", Me.[start], Me.[end])
'set the color of the bar based on a data value
Me.txtName.Width = 10 'avoid the positioning error
Me.txtName.Left = (lngStart * dblFactor) + lngLMarg
Me.txtName.Width = (lngDuration * dblFactor)
Me.MoveLayout = True
End Sub

However, I have some employees who start or end on the half hour and this
places them on the full hour. How do I go about changing it so the timeline
will reflect 1/2 hours?

Duane Hookom said:
Glad to hear you got this working. Come back if you have questions since you
have the attention of the author ;-)
--
Duane Hookom
Microsoft Access MVP


:

Great ... both the new link and the "unblock" worked so now I can attempt it.
Thanks so much for your help.

:

The invisibleinc file is now located at
http://www.access.hookom.net/Samples.htm. Most files you download from the
intranet have a property set that you need to change so you can open them.
After downloading, right-click the file and choose Properties. I think the
property is like "unblock".

--
Duane Hookom
Microsoft Access MVP


:

I'm looking for instructions on how to do a Gantt Timeline. I've gone to
this suggested website ...
http://www.invisibleinc.com/divFiles.cfm?divDivID=4 ... but the link doesn't
work. Then I went here ...http://mvps.org/access/reports/rpt0018.htm and
downloaded the files, but when I go to open the database, it tells me I must
install the database on my computer . Exact phrase: File is located on an
intranet or untrusted site. Not so, opening it from the C: drive.

So I'm still looking, any help would be appreciated.

Margaret
 
D

Duane Hookom

The lngDuration memory variable is used to capture/store the number of hours
from the start to finish of an event (duration). The results returned from
DateDiff() are always integers (whole numbers with no decimal).

You wanted half hours (or better) so the lngDuration needed to be changed to
accomodate fractions/decimals. The "As Long" wouldn't allow for storing
decimals while "As Double" does.

The "h" or "n" in DateDiff() is to return the duration in either Hours or
Minutes ("m" is month).

The code changes find the difference in minutes and divides by 60 to convert
to the number of hours with decimals.
--
Duane Hookom
Microsoft Access MVP


margaret said:
Worked like a champ. But if you don't mind two questions:

1. difference between "long" and "double"
2. why the change between the "h" and "n"

Thanks for your help. I just don't want to put code in that I don't totally
understand.

Duane Hookom said:
I think you need to change

Dim lngDuration As Long 'hours of work

lngDuration = DateDiff("h", Me.[start], Me.[end])
to
Dim lngDuration As Double 'hours of work

lngDuration = DateDiff("n", Me.[start], Me.[end])/60

--
Duane Hookom
Microsoft Access MVP


margaret said:
I have the following code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim lngDuration As Long 'hours of work
Dim lngStart As Long 'start hour of tour
Dim lngLMarg As Long
Dim dblFactor As Double
'put a line control in your page header that starts 12:00 and goes to
23:00
lngLMarg = Me.boxTimeLine.Left
dblFactor = Me.boxTimeLine.Width / 24
lngStart = DateDiff("h", #12:00:00 AM#, Me.[start])
lngDuration = DateDiff("h", Me.[start], Me.[end])
'set the color of the bar based on a data value
Me.txtName.Width = 10 'avoid the positioning error
Me.txtName.Left = (lngStart * dblFactor) + lngLMarg
Me.txtName.Width = (lngDuration * dblFactor)
Me.MoveLayout = True
End Sub

However, I have some employees who start or end on the half hour and this
places them on the full hour. How do I go about changing it so the timeline
will reflect 1/2 hours?

:

Glad to hear you got this working. Come back if you have questions since you
have the attention of the author ;-)
--
Duane Hookom
Microsoft Access MVP


:

Great ... both the new link and the "unblock" worked so now I can attempt it.
Thanks so much for your help.

:

The invisibleinc file is now located at
http://www.access.hookom.net/Samples.htm. Most files you download from the
intranet have a property set that you need to change so you can open them.
After downloading, right-click the file and choose Properties. I think the
property is like "unblock".

--
Duane Hookom
Microsoft Access MVP


:

I'm looking for instructions on how to do a Gantt Timeline. I've gone to
this suggested website ...
http://www.invisibleinc.com/divFiles.cfm?divDivID=4 ... but the link doesn't
work. Then I went here ...http://mvps.org/access/reports/rpt0018.htm and
downloaded the files, but when I go to open the database, it tells me I must
install the database on my computer . Exact phrase: File is located on an
intranet or untrusted site. Not so, opening it from the C: drive.

So I'm still looking, any help would be appreciated.

Margaret
 
M

margaret

Thank you much for the explanation ... that goes a long way in understanding
your code.

Duane Hookom said:
The lngDuration memory variable is used to capture/store the number of hours
from the start to finish of an event (duration). The results returned from
DateDiff() are always integers (whole numbers with no decimal).

You wanted half hours (or better) so the lngDuration needed to be changed to
accomodate fractions/decimals. The "As Long" wouldn't allow for storing
decimals while "As Double" does.

The "h" or "n" in DateDiff() is to return the duration in either Hours or
Minutes ("m" is month).

The code changes find the difference in minutes and divides by 60 to convert
to the number of hours with decimals.
--
Duane Hookom
Microsoft Access MVP


margaret said:
Worked like a champ. But if you don't mind two questions:

1. difference between "long" and "double"
2. why the change between the "h" and "n"

Thanks for your help. I just don't want to put code in that I don't totally
understand.

Duane Hookom said:
I think you need to change

Dim lngDuration As Long 'hours of work

lngDuration = DateDiff("h", Me.[start], Me.[end])
to
Dim lngDuration As Double 'hours of work

lngDuration = DateDiff("n", Me.[start], Me.[end])/60

--
Duane Hookom
Microsoft Access MVP


:

I have the following code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim lngDuration As Long 'hours of work
Dim lngStart As Long 'start hour of tour
Dim lngLMarg As Long
Dim dblFactor As Double
'put a line control in your page header that starts 12:00 and goes to
23:00
lngLMarg = Me.boxTimeLine.Left
dblFactor = Me.boxTimeLine.Width / 24
lngStart = DateDiff("h", #12:00:00 AM#, Me.[start])
lngDuration = DateDiff("h", Me.[start], Me.[end])
'set the color of the bar based on a data value
Me.txtName.Width = 10 'avoid the positioning error
Me.txtName.Left = (lngStart * dblFactor) + lngLMarg
Me.txtName.Width = (lngDuration * dblFactor)
Me.MoveLayout = True
End Sub

However, I have some employees who start or end on the half hour and this
places them on the full hour. How do I go about changing it so the timeline
will reflect 1/2 hours?

:

Glad to hear you got this working. Come back if you have questions since you
have the attention of the author ;-)
--
Duane Hookom
Microsoft Access MVP


:

Great ... both the new link and the "unblock" worked so now I can attempt it.
Thanks so much for your help.

:

The invisibleinc file is now located at
http://www.access.hookom.net/Samples.htm. Most files you download from the
intranet have a property set that you need to change so you can open them.
After downloading, right-click the file and choose Properties. I think the
property is like "unblock".

--
Duane Hookom
Microsoft Access MVP


:

I'm looking for instructions on how to do a Gantt Timeline. I've gone to
this suggested website ...
http://www.invisibleinc.com/divFiles.cfm?divDivID=4 ... but the link doesn't
work. Then I went here ...http://mvps.org/access/reports/rpt0018.htm and
downloaded the files, but when I go to open the database, it tells me I must
install the database on my computer . Exact phrase: File is located on an
intranet or untrusted site. Not so, opening it from the C: drive.

So I'm still looking, any help would be appreciated.

Margaret
 
M

margaret

Is there anyway to get this to work for a 24 schedule. In that maybe the
employees work 7:00 am to 3 pm ; 3 pm to 11:pm and then 11:pm to 7:00 am.
I'm not concerned about a day of the week. I just need to see that all
twenty four hours are covered.

margaret said:
Thank you much for the explanation ... that goes a long way in understanding
your code.

Duane Hookom said:
The lngDuration memory variable is used to capture/store the number of hours
from the start to finish of an event (duration). The results returned from
DateDiff() are always integers (whole numbers with no decimal).

You wanted half hours (or better) so the lngDuration needed to be changed to
accomodate fractions/decimals. The "As Long" wouldn't allow for storing
decimals while "As Double" does.

The "h" or "n" in DateDiff() is to return the duration in either Hours or
Minutes ("m" is month).

The code changes find the difference in minutes and divides by 60 to convert
to the number of hours with decimals.
--
Duane Hookom
Microsoft Access MVP


margaret said:
Worked like a champ. But if you don't mind two questions:

1. difference between "long" and "double"
2. why the change between the "h" and "n"

Thanks for your help. I just don't want to put code in that I don't totally
understand.

:

I think you need to change

Dim lngDuration As Long 'hours of work

lngDuration = DateDiff("h", Me.[start], Me.[end])
to
Dim lngDuration As Double 'hours of work

lngDuration = DateDiff("n", Me.[start], Me.[end])/60

--
Duane Hookom
Microsoft Access MVP


:

I have the following code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim lngDuration As Long 'hours of work
Dim lngStart As Long 'start hour of tour
Dim lngLMarg As Long
Dim dblFactor As Double
'put a line control in your page header that starts 12:00 and goes to
23:00
lngLMarg = Me.boxTimeLine.Left
dblFactor = Me.boxTimeLine.Width / 24
lngStart = DateDiff("h", #12:00:00 AM#, Me.[start])
lngDuration = DateDiff("h", Me.[start], Me.[end])
'set the color of the bar based on a data value
Me.txtName.Width = 10 'avoid the positioning error
Me.txtName.Left = (lngStart * dblFactor) + lngLMarg
Me.txtName.Width = (lngDuration * dblFactor)
Me.MoveLayout = True
End Sub

However, I have some employees who start or end on the half hour and this
places them on the full hour. How do I go about changing it so the timeline
will reflect 1/2 hours?

:

Glad to hear you got this working. Come back if you have questions since you
have the attention of the author ;-)
--
Duane Hookom
Microsoft Access MVP


:

Great ... both the new link and the "unblock" worked so now I can attempt it.
Thanks so much for your help.

:

The invisibleinc file is now located at
http://www.access.hookom.net/Samples.htm. Most files you download from the
intranet have a property set that you need to change so you can open them.
After downloading, right-click the file and choose Properties. I think the
property is like "unblock".

--
Duane Hookom
Microsoft Access MVP


:

I'm looking for instructions on how to do a Gantt Timeline. I've gone to
this suggested website ...
http://www.invisibleinc.com/divFiles.cfm?divDivID=4 ... but the link doesn't
work. Then I went here ...http://mvps.org/access/reports/rpt0018.htm and
downloaded the files, but when I go to open the database, it tells me I must
install the database on my computer . Exact phrase: File is located on an
intranet or untrusted site. Not so, opening it from the C: drive.

So I'm still looking, any help would be appreciated.

Margaret
 
D

Duane Hookom

You can set the scale to whatever you want. It's all in the math of finding
the datediff and positioning and sizing the control.
--
Duane Hookom
Microsoft Access MVP


margaret said:
Is there anyway to get this to work for a 24 schedule. In that maybe the
employees work 7:00 am to 3 pm ; 3 pm to 11:pm and then 11:pm to 7:00 am.
I'm not concerned about a day of the week. I just need to see that all
twenty four hours are covered.

margaret said:
Thank you much for the explanation ... that goes a long way in understanding
your code.

Duane Hookom said:
The lngDuration memory variable is used to capture/store the number of hours
from the start to finish of an event (duration). The results returned from
DateDiff() are always integers (whole numbers with no decimal).

You wanted half hours (or better) so the lngDuration needed to be changed to
accomodate fractions/decimals. The "As Long" wouldn't allow for storing
decimals while "As Double" does.

The "h" or "n" in DateDiff() is to return the duration in either Hours or
Minutes ("m" is month).

The code changes find the difference in minutes and divides by 60 to convert
to the number of hours with decimals.
--
Duane Hookom
Microsoft Access MVP


:

Worked like a champ. But if you don't mind two questions:

1. difference between "long" and "double"
2. why the change between the "h" and "n"

Thanks for your help. I just don't want to put code in that I don't totally
understand.

:

I think you need to change

Dim lngDuration As Long 'hours of work

lngDuration = DateDiff("h", Me.[start], Me.[end])
to
Dim lngDuration As Double 'hours of work

lngDuration = DateDiff("n", Me.[start], Me.[end])/60

--
Duane Hookom
Microsoft Access MVP


:

I have the following code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim lngDuration As Long 'hours of work
Dim lngStart As Long 'start hour of tour
Dim lngLMarg As Long
Dim dblFactor As Double
'put a line control in your page header that starts 12:00 and goes to
23:00
lngLMarg = Me.boxTimeLine.Left
dblFactor = Me.boxTimeLine.Width / 24
lngStart = DateDiff("h", #12:00:00 AM#, Me.[start])
lngDuration = DateDiff("h", Me.[start], Me.[end])
'set the color of the bar based on a data value
Me.txtName.Width = 10 'avoid the positioning error
Me.txtName.Left = (lngStart * dblFactor) + lngLMarg
Me.txtName.Width = (lngDuration * dblFactor)
Me.MoveLayout = True
End Sub

However, I have some employees who start or end on the half hour and this
places them on the full hour. How do I go about changing it so the timeline
will reflect 1/2 hours?

:

Glad to hear you got this working. Come back if you have questions since you
have the attention of the author ;-)
--
Duane Hookom
Microsoft Access MVP


:

Great ... both the new link and the "unblock" worked so now I can attempt it.
Thanks so much for your help.

:

The invisibleinc file is now located at
http://www.access.hookom.net/Samples.htm. Most files you download from the
intranet have a property set that you need to change so you can open them.
After downloading, right-click the file and choose Properties. I think the
property is like "unblock".

--
Duane Hookom
Microsoft Access MVP


:

I'm looking for instructions on how to do a Gantt Timeline. I've gone to
this suggested website ...
http://www.invisibleinc.com/divFiles.cfm?divDivID=4 ... but the link doesn't
work. Then I went here ...http://mvps.org/access/reports/rpt0018.htm and
downloaded the files, but when I go to open the database, it tells me I must
install the database on my computer . Exact phrase: File is located on an
intranet or untrusted site. Not so, opening it from the C: drive.

So I'm still looking, any help would be appreciated.

Margaret
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top