473,387 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Timeline display

7
Hi all,

I'm working on a litle project and have run into a snag.

I would like to read the starting/ending dates of specific users and display then in a timeline.

This is just to show when a user is booked and for which days ie



Can anybody assist in how to create something like this in Access?

Regards
Jun 6 '07 #1
9 9623
ADezii
8,834 Expert 8TB
Hi all,

I'm working on a litle project and have run into a snag.

I would like to read the starting/ending dates of specific users and display then in a timeline.

This is just to show when a user is booked and for which days ie



Can anybody assist in how to create something like this in Access?

Regards
I do not know of any mechanism within Access by which this could easily be accomplished. Off the top of my head, the closest approximation would be a series of 7 Check Boxes (M thru S) for any given Date which could then be checked and give some visual indication of a Time Line but this seems a little far fetched (2,555 Check Boxes for a given Year per person). Give me a little time to think on it.
Jun 7 '07 #2
FishVal
2,653 Expert 2GB
Hi all,

I'm working on a litle project and have run into a snag.

I would like to read the starting/ending dates of specific users and display then in a timeline.

This is just to show when a user is booked and for which days ie



Can anybody assist in how to create something like this in Access?

Regards

The image you've provided resembles MSProject document. Have you think about exporting your data to MSProject document opened either as separate application or as Unbound object control on a form ?
Jun 8 '07 #3
berndh
7
It looks very similar to MS Project indeed, but was designed in another package using the web as front-end and SQL as a backend, I was just given a sample to see if it can be done in ACCESS to save on costs.

I was thinking along the lines of 365 boxes in a table, start gets an image and everyting between another, the ending then gets another image to make it look nice???

STUCK...
Jun 8 '07 #4
FishVal
2,653 Expert 2GB
It looks very similar to MS Project indeed, but was designed in another package using the web as front-end and SQL as a backend, I was just given a sample to see if it can be done in ACCESS to save on costs.

I was thinking along the lines of 365 boxes in a table, start gets an image and everyting between another, the ending then gets another image to make it look nice???

STUCK...

If I've understood what do you mean, you want to solve it via sql queries.
I'm not sure whether this solution will succeed.

I reccomend you the following:
1) you've said that this was previously implemented using some Activex control, have you thought about using this control in Access
2) you may obtain Activex control implementing Gantt's chart presentation
3) you may use Excel
4) and at last you may use MSProject -

hereby is my solution

tblUsers
keyUserID (PK, Long(Autonumber))
txtName (Text)

tblBookings
keyBookingID (PK, Long(Autonumber))
keyUserID (FK, Long(Autonumber))
dteBookedOn (Date)
intDays (Integer)

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub btnMSProject_Click()
  3.  
  4.     Dim prjProject As MSProject.Project
  5.     Dim appMSProject As MSProject.Application
  6.     Dim tskTask As MSProject.Task
  7.     Dim rsUsers As New ADODB.Recordset
  8.     Dim rsBookings As New ADODB.Recordset
  9.     Dim sqlQuery As New SQLSelect
  10.     Dim strSQL As String
  11.     Dim dteDate As Date, dteStart As Date, dteEnd As Date
  12.  
  13.     Set appMSProject = CreateObject("MSProject.Application")
  14.     Set prjProject = appMSProject.Projects.Add
  15.  
  16.     strSQL = "SELECT * FROM tblUsers;"
  17.     rsUsers.Open strSQL, CurrentProject.Connection, _
  18.         adOpenForwardOnly, adLockReadOnly
  19.  
  20.     While Not rsUsers.EOF
  21.  
  22.         Set tskTask = prjProject.Tasks.Add
  23.         tskTask.Name = rsUsers![txtName]
  24.  
  25.         strSQL = "SELECT * FROM tblBookings WHERE keyUserID=" & rsUsers![keyUserID] & _
  26.             " ORDER BY dteBookedOn ASC;"
  27.         rsBookings.Open strSQL, CurrentProject.Connection, _
  28.             adOpenDynamic, adLockOptimistic
  29.  
  30.         With tskTask
  31.             rsBookings.MoveFirst
  32.             appMSProject.ProjectSummaryInfo _
  33.                 Start:=DateAdd("d", -1, rsBookings![dteBookedOn])
  34.             dteDate = rsBookings![dteBookedOn]
  35.             .Start = dteDate
  36.             rsBookings.MoveLast
  37.             dteDate = DateAdd("d", Nz(rsBookings![intDays], 1) - 1, _
  38.                 rsBookings![dteBookedOn])
  39.             .Finish = dteDate
  40.             rsBookings.MoveFirst
  41.         End With
  42.  
  43.         Do
  44.             dteStart = DateAdd("d", Nz(rsBookings![intDays], 1), _
  45.                 rsBookings![dteBookedOn])
  46.             rsBookings.MoveNext
  47.             If Not rsBookings.EOF Then
  48.                 dteEnd = rsBookings![dteBookedOn]
  49.                 tskTask.Split dteStart, dteEnd
  50.             Else
  51.                 tskTask.Finish = dteStart
  52.                 Exit Do
  53.             End If
  54.         Loop
  55.  
  56.         rsBookings.Close
  57.         rsUsers.MoveNext
  58.  
  59.     Wend
  60.  
  61.     rsUsers.Close
  62.     appMSProject.Visible = True
  63.  
  64.     Set tskTask = Nothing
  65.     Set rsBookings = Nothing
  66.     Set rsUsers = Nothing
  67.     Set prjProject = Nothing
  68.     Set appMSProject = Nothing
  69.  
  70. End Sub
  71.  
  72.  
Good Luck
Jun 9 '07 #5
FishVal
2,653 Expert 2GB
Sorry, a bug was detected. Method Task.Split check whether it falls into nonworking days and do what it supposes to be right.
So I've added code which sets all week days to working.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub btnMSProject_Click()
  3.  
  4.     Dim prjProject As MSProject.Project
  5.     Dim appMSProject As MSProject.Application
  6.     Dim tskTask As MSProject.Task
  7.     Dim rsUsers As New ADODB.Recordset
  8.     Dim rsBookings As New ADODB.Recordset
  9.     Dim sqlQuery As New SQLSelect
  10.     Dim strSQL As String
  11.     Dim dteDate As Date, dteStart As Date, dteEnd As Date
  12.  
  13.     Set appMSProject = CreateObject("MSProject.Application")
  14.     Set prjProject = appMSProject.Projects.Add
  15.  
  16.     '---- Set all week days as working because Task.Split method is too clever
  17.     For Each wd In prjProject.Calendar.WeekDays
  18.         wd.Working = True
  19.     Next
  20.  
  21.     strSQL = "SELECT * FROM tblUsers;"
  22.     rsUsers.Open strSQL, CurrentProject.Connection, _
  23.         adOpenForwardOnly, adLockReadOnly
  24.  
  25.     While Not rsUsers.EOF
  26.  
  27.         Set tskTask = prjProject.Tasks.Add
  28.         tskTask.Name = rsUsers![txtName]
  29.  
  30.         strSQL = "SELECT * FROM tblBookings WHERE keyUserID=" & rsUsers![keyUserID] & _
  31.             " ORDER BY dteBookedOn ASC;"
  32.         rsBookings.Open strSQL, CurrentProject.Connection, _
  33.             adOpenDynamic, adLockOptimistic
  34.  
  35.         With tskTask
  36.             rsBookings.MoveFirst
  37.             appMSProject.ProjectSummaryInfo _
  38.                 Start:=DateAdd("d", -1, rsBookings![dteBookedOn])
  39.             dteDate = rsBookings![dteBookedOn]
  40.             .Start = dteDate
  41.             rsBookings.MoveLast
  42.             dteDate = DateAdd("d", Nz(rsBookings![intDays], 1) - 1, _
  43.                 rsBookings![dteBookedOn])
  44.             .Finish = dteDate
  45.             rsBookings.MoveFirst
  46.         End With
  47.  
  48.         Do
  49.             dteStart = DateAdd("d", Nz(rsBookings![intDays], 1), _
  50.                 rsBookings![dteBookedOn])
  51.             rsBookings.MoveNext
  52.             If Not rsBookings.EOF Then
  53.                 dteEnd = rsBookings![dteBookedOn]
  54.                 If dteStart < dteEnd Then tskTask.Split dteStart, dteEnd
  55.             Else
  56.                 tskTask.Finish = dteStart
  57.                 Exit Do
  58.             End If
  59.         Loop
  60.  
  61.         rsBookings.Close
  62.         rsUsers.MoveNext
  63.  
  64.     Wend
  65.  
  66.     rsUsers.Close
  67.     appMSProject.Visible = True
  68.  
  69.     Set tskTask = Nothing
  70.     Set rsBookings = Nothing
  71.     Set rsUsers = Nothing
  72.     Set prjProject = Nothing
  73.     Set appMSProject = Nothing
  74.  
  75. End Sub
  76.  
  77.  
Jun 9 '07 #6
Have a look at this. It may give you some ideas without going to heavily in to coding



http://www.access-programmers.co.uk/forums/showthread.php?t=108369
Jun 10 '07 #7
berndh
7
Stunning, thanks for the input. Will fiddle.
Jun 14 '07 #8
berndh
7
Hi again,

Problem....

As far as I understand, Gantt charts do no allow for "multiple item" listings per line...

Ie, we have Paul and it shows him to have two appointments (or three or four etc), underneath him would be Mary, with a few appointments etc etc, now there needs to be one line per person / resource which shows they availebility. A gantt chart will add a new line for every new event..

There was a web page created by somebody else, I do not have the code or the sample as it was a proposal from their side, just WAY tooooo expensive, hence it has been deleted.
Jun 14 '07 #9
FishVal
2,653 Expert 2GB
Hi again,

Problem....

As far as I understand, Gantt charts do no allow for "multiple item" listings per line...

Ie, we have Paul and it shows him to have two appointments (or three or four etc), underneath him would be Mary, with a few appointments etc etc, now there needs to be one line per person / resource which shows they availebility. A gantt chart will add a new line for every new event..

There was a web page created by somebody else, I do not have the code or the sample as it was a proposal from their side, just WAY tooooo expensive, hence it has been deleted.
Hi!

The code in #6 displays exactly what you want. The only question is whether MSProject is too expensive for you or not.
Jun 14 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Cobb | last post by:
Hello- I'm interested in building a graphical timeline for a series of tasks that are stored in a SQL Server 2000 database. The tasks reside within a table. We also have a table to track the...
0
by: Thorsten Bast | last post by:
Hi, I'm sorry if this problem should have been sufficiently discussed here, but so far I could not find a satisfactory answer. I'm managing rental contracts with an access database and want to...
0
by: Abhishek Bagga | last post by:
I want to Display a timeline in my Application based on which I will create a flow of series. How can I create a Timeline, somewhat similar to the ones available in video authoring tools. ...
5
by: krose | last post by:
I am looking for a control that would look like a timeline (12 hours) which would allow the user to click at a particular location on the timeline, then allow characteristics to be associated with...
17
by: jshanman | last post by:
I am working on a timeline API that devevelopers can use to add a dynamic timeline to their sites. Here is a *working* demo of the basic interface. (it works for me anyway on ie6 & firefox 1.5)...
4
by: Martin Schneider | last post by:
Hi! I am currently writing an application allowing to plan events on a time basis. The ideal approach would be to show a "timeline" display, just like in a video editing software, allowing to...
0
by: nbt725 | last post by:
Dear Sir, Hello ! I have use simile timeline. (http://simile.mit.edu/mail.html). I am new to timeline and would like to do following, please guide me. In my timeline I have created 2 bands one...
1
by: doublestack | last post by:
Hi everyone, I have a xml file that Simile Timeline uses to call events...Some of the events have links in them and I need to have those links open a new window. As it stands now the links replace...
5
by: doublestack | last post by:
Hi everyone, I have a xml file that Simile Timeline uses to call events...Some of the events have links in them and I need to have those links open a new window. As it stands now the links replace...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.