Results 1 to 3 of 3
  1. #1
    jmcr is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2014
    Posts
    1

    how to represent a graphical display of time duration on a report or form


    I have a Schedule table with the following fields:
    Date (LongDate)
    AgentID (Number)
    ShiftStartTime (ShortTime)
    ShiftEndTime (ShortTime)

    I would like to represent this information graphically with horizontal bars on either or both a report and form
    For instance:
    ..............................|8am ...................... |12pm....................... ......|4pm................................ |8
    Agent 1: 8:30-5:30....... [|||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||||||||]
    Agent 2: 12-4 ........................................ [|||||||||||||||||||||||||||||]
    Agent 3: 10-6 ....................... [|||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||||||]
    etc...

    Is there some way I can do this using VBA? Maybe formatting a txtbox size and coloring through VBA code based on a Datediff value?

    Or maybe an easier way?

    I am relatively new to VBA but understand programming concepts. Any assistance or example of simple code would be greatly appreciated.


    Thanks

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I seem to recall a thread using the Form's Timer Event and the Width property of a control. Using the forms' timer event can be expensive in terms of RAM though.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Although not using a bar display, this thread discusses methods to display a schedule for days of month horizontally. https://www.accessforums.net/databas...ses-18459.html

    Problem with setting a control's width property (programmatically or manually) on form is the width would be the same for every record. However, setting it programmatically in report OnFormat event works - the event runs only when report opened in PrintPreview or direct to printer. I think the real trick would be determining the Left position of control.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 05-22-2013, 09:32 PM
  2. Duration field NOT time
    By rockcliff15 in forum Access
    Replies: 6
    Last Post: 04-15-2012, 12:22 PM
  3. Access 2003's graphical capabilities
    By e.badin in forum Access
    Replies: 3
    Last Post: 01-05-2011, 12:28 PM
  4. Replies: 11
    Last Post: 01-26-2010, 08:41 AM
  5. Replies: 1
    Last Post: 12-29-2005, 01:15 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums