Results 1 to 5 of 5
  1. #1
    unclejemima is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2016
    Posts
    2

    NOOB calendar question, someone built Access Calendar and changing colors


    We've had someone build us a time schedule using Access. The application looks good and how it functions is pretty remarkable.

    Basically we create a schedule for "On Shift, Off Shift, Vacation" etc. Then Another part of the record is pulled from our RFID Key tags, what will fill in "Clocked In" and "Clocked Out" so you know if someone showed up for the day.

    Only we ran into a slight snag near the end where we're about to roll out the application.

    Our plan was to color text of users in future events so you can quickly see if your on shift, or off shift. If your on-shift, its black, off shift is red. Turns out this is not possible the way the calendar was built, we're only able to change ALL the text inside a box that represents a day of the month view, but we can't individually color in a cell. For example, if you take May 11. If your off shift, it would show Red. On shift, black. When you clock in it shows green.

    Now I know basically nothing about Access, but I want to learn. This if probably super advanced for me, but can anyone tell me if it might be possible to change text of content inside a cell dependent on the status? If not, how would we have to modify the calendar so we could do so?

    See attached.

    Thanks!

    Click image for larger version. 

Name:	Staff Schedule.jpg 
Views:	31 
Size:	147.4 KB 
ID:	24769

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    perhaps it can be done - I provided a solution to a similar question on this thread.

    https://www.accessforums.net/showthread.php?t=59992

    you probably have a function or sql that is building the contents of each days 'cell' so it could be modified to include the colour codes depending on shift status.

  3. #3
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    Access us very very friendly when it comes to these kind of things. I would recommend promoting the controls that you store text in to be RichTextBox Controls. From there its a simple matter to color any text or do other nifty things, like insert links and additional formatting.

  4. #4
    unclejemima is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2016
    Posts
    2
    Quote Originally Posted by Perceptus View Post
    Access us very very friendly when it comes to these kind of things. I would recommend promoting the controls that you store text in to be RichTextBox Controls. From there its a simple matter to color any text or do other nifty things, like insert links and additional formatting.
    Thanks Guys. Problem is I don't think the calendar is built with text boxes...not sure how I would find out how its built?

    I checked the code being used for the colors and it appears long colors are being specified...example:
    Const dsColorBlack As Long = 8388608
    Const dsColorDarkBlue As Long = 8388608
    Const dsColorDarkGreen As Long = 32768
    Const dsColorDarkRed As Long = 4210816
    Etc....


    Here is an example of how the colors are being used. Right now we're only able to generate colors for the entire calendar day, not the individual events inside the day.

    If (mrsTask!ScheduleStatus = "Stat-Day") Then
    .BorderWidth = 2
    .BorderColor = dsColorPurple
    End If
    If (mrsTask!ScheduleStatus = "Stat-Day") Then
    .ForeColor = dsColorPurple

    ElseIf mrsTask!AssignDate < Date Then
    .ForeColor = dsColorDarkGray ' Changes the past event Calendar
    .BorderWidth = 1
    .BorderColor = dsColorDarkGray
    ElseIf mrsTask!AssignDate > Date Then
    .ForeColor = dsColorDarkGray ' Changes the Future event Calendar
    .BorderWidth = 1
    .BorderColor = dsColorDarkGray
    ElseIf mrsTask!AssignDate = Null Then
    .ForeColor = dsColorDarkGray ' Changes the Empty event Calendar
    .BorderWidth = 1
    .BorderColor = dsColorDarkGray
    ElseIf mrsTask!AssignDate = Date Then ' This Will handle the current Date for Events
    If (mrsTask!ScheduleStatus = "On-Shift") Then
    .ForeColor = vbBlack
    .BorderWidth = 2
    .BorderColor = dsColorDarkGreen
    End If
    If (mrsTask!ScheduleStatus = "Absent") Then
    .ForeColor = rgb(255, 0, 0)
    .BorderWidth = 2
    .BorderColor = rgb(255, 0, 0)
    End If

    With the above code can anyone gather how I would modify it for specific colors for the events inside the calendar day?

    Thanks!!!

  5. #5
    CHEECO is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    156
    This is just a suggestion but, why don't you attach a copy of the Calendar database. This may lead to more help from the other members. It will also make it easier for them to determine the problem and make suggestions.

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

Similar Threads

  1. Calendar Question
    By jo15765 in forum Forms
    Replies: 1
    Last Post: 04-03-2014, 09:39 AM
  2. Replies: 4
    Last Post: 11-16-2011, 04:46 PM
  3. Question about ActiveX Calendar
    By Buakaw in forum Access
    Replies: 0
    Last Post: 03-01-2011, 02:59 AM
  4. Calendar Birthday Question
    By kirklandwater123 in forum Access
    Replies: 4
    Last Post: 10-29-2010, 11:20 PM
  5. Calendar question in access 2007
    By DPG in forum Database Design
    Replies: 6
    Last Post: 10-06-2010, 11:22 AM

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