Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Join Date
    Nov 2020
    Posts
    7

    How to put time range in just one cell in calendar

    Hi All,

    I am new to access. I am doing a calendar for job allocation, and i need the time range to be in just one cell instead of ditto as shown in the image. Like if the time slot is 8 to 3pm, it should show as 8.00 to 3.00 pm in that one cell instead of dragged down until the end time.



    Cheers
    Attached Thumbnails Attached Thumbnails Access Calender.JPG  

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    All without seeing the actual code/DB?

  3. #3
    Join Date
    Nov 2020
    Posts
    7
    Private Sub cmdOpenAppt_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)


    'Opens Appointment form
    'Entry (vDate) holds date of selected cell
    ' (vRowNo) holds selected RowNo (1 - 48) (used to calc time slot)
    'Exit Appointment form displayed


    Dim vDate As Date
    Dim vTime As Date


    On Error GoTo ErrorCode


    vDate = Me.Parent!txtDate + (X \ Me.Day1Data.Width) 'calc date of selected column
    vTime = DateAdd("n", (Me.RowNo - 1) * TempVars("tmpPeriod"), 0) 'calc time from RowNo
    Me.Parent!txtCurrentDate = vDate & " " & vTime 'copy selected date & time to Current Date
    UpdateWeeklyHeaders Me.Parent, vDate 'display header week dates
    Me.Parent!cmdGoToLast.Enabled = True
    DoCmd.OpenForm "frmCalendarAppt", , , , , acDialog, vDate & " " & vTime & "," & Me.WindowTop - 400 & "," & Me.Parent!txtCategory & "," & Me.Parent!cboEmployee 'open frmCalendarAppt form to add or amend appointment
    ShowWeekAppts Me.Parent, Me.Parent.txtDate, Me.Parent!txtCategory, Me.Parent!cboEmployee 'update table
    Parent.frmCalendarWeek.Requery 'and refresh form
    Exit Sub


    ErrorCode:
    MsgBox Err.Description


    End Sub

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    Would also need to see what is in frmCalendarAppt ?

    Can you upload the DB?, as this is like looking for a needle in a haystack, without knowing which haystack.

  5. #5
    Join Date
    Nov 2020
    Posts
    7
    Attached DB in zip folder.
    Thanks
    Attached Files Attached Files

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    That took me a while. Lovely DB, but very complicated to be as good as it is.

    I would probably approach it this way.
    In modCalendarCode and sub ShowMonthAppts I would add code to add the end time just as the start time is being added to vSubject. ?
    To do that, you will need to create another TempVar to hold the choice of showing EndTime. That way it will keep it's flexibility.

    the code I am talking about is here

    Code:
            If TempVars("tmpShowStart") = True Then vSubject = Format(rst!ApptStart, " h:nn ")                                    'if ShowStart = True then add Start Time only
            If TempVars("tmpShowStartEnd") = True Then vSubject = Format(rst!ApptStart, " h:nn-") & Format(rst!ApptEnd, "h:nn ")  'if TempVars("tmpShowStart")End = True then add Start Time & End Time to vSubject
            If TempVars("tmpShowSubject") = True Then vSubject = vSubject & rst!ApptSubject                                       'if TempVars("tmpShowSubject") = True then add Subject field to vSubject
            If TempVars("tmpShowLocation") = True Then vSubject = vSubject & " " & rst!ApptLocation                               'if TempVars("tmpShowLocation") = True then add Location field to vSubject
    I had to comment out a fair bit of code due to my Access being so old and not having those properties

    Tempvars are set in InitialiseDefaults and they get their values from tblCalendarSettings, so you will need to add a new field in that table and amend code to suit.

    Where did you get this, as I know someone who was looking for something like this.?

    HTH

    Edit: And after doing all that and just reviewing the post, I can see that the author did that already. You just need to amend the settings in the form CalendarSettings and tick show start and end times.

    Not to worry, as it was a learning experience for me and this DB will help someone else.

  7. #7
    Join Date
    Nov 2020
    Posts
    7
    Hi,
    Thanks for the feedback. I amended the settings in form Calendersettings and what I am getting is start and end times in each row from start time slot to the end time slot as shown in image attached. What I need is just to appear in the start time slot(8:00) as highlighted blue and subsequent rows to be empty, so that I can schedule other events on those time periods.
    Thanks again,



    Click image for larger version. 

Name:	Access Calender1.JPG 
Views:	22 
Size:	129.6 KB 
ID:	43539

    I got this DB online. It's called Appointment Calender by Peter Hibbs. Cheers

  8. #8
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    That also has to be a setting, as I get this.
    This is a very powerful and appears quite flexible app.
    I can see that you have just utilised it for your needs, as I doubt General would be an employee, but to amend such a complex program, is always going to take a fair bit of effort unless you know the program well.

    I noticed after, that this was created by the renowned Peter Hibbs.?
    He would be my first port of call if you needed a new feature as we are on V32, so he appears amenable to making it even better?


    Attached Thumbnails Attached Thumbnails Capture.PNG  
    Last edited by Welshgasman; 12-04-2020 at 03:55 AM. Reason: trying to add pics

  9. #9
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    I tried removing the ditto, but that repeats the control entry. I would prefer the ditto?

    I am confused as to your request.? Surely the whole idea of this app is NOT to schedule anything when something has been scheduled for a certain employee?

    I have scheduled overlapping times, but for different employee as per form main and category.

    Again, Peter Hibbs would be the best place to start.

    I mentioned this in another forum and was shown this link https://utteraccess.com/topics/1969978

  10. #10
    Join Date
    Nov 2020
    Posts
    7
    Hi,
    Thanks for the reply,
    There might be a scenario where another employee is working on another machine on same time slot, hence need the ditto removed and need the time slot to appear only on start time.
    Thanks

  11. #11
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    I understand that, but you have to put that under that employee name.?

    I cannot see where all employees appointments can be seen.?

    Peter *might* have thought of that, but he would be the best one to ask.?

    I have added two overlapping appointments on the same day BUT they are for different employees.?

    Try unsetting Bar Appointments ... in settings and see if that will do what you need.

    I think you are trying to bend this in a way it was not designed as it is for a certain purpose.?

    I unset that setting and can add another appointment, but it only shows by colour.?

    Again, go to the source. He can tell you immediately 'No it will not do that' or 'OK I can add that'.
    Attached Thumbnails Attached Thumbnails Capture.PNG  

  12. #12
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    I have just looked at the thread for the link I posted and Peter is still responding to queries/bugs, even to last month?.?

    Word or warning.

    Give exact detail on how you are using it.
    No one likes trying to make head or tail of a query when it is not described correctly.

    There are some users on another forum, where everything is one liners and it is hard work getting to the bottom of the problem.

    TBH I have learnt just to ignore those, under the reasoning, if they cannot be bothered to supply enough detail/data to explian the problem, then I am not going to waste my time, and will find someone who is prepared to do that. There is no shortage of those either.

    Good luck anyway.

  13. #13
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    TBH I have learnt just to ignore those, under the reasoning, if they cannot be bothered to supply enough detail/data to explain the problem, then I am not going to waste my time, and will find someone who is prepared to do that. There is no shortage of those either.
    I totally agree with that. And the best way for a poster to get on my ignore list is to not even bother to respond to followup questions.

  14. #14
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    Like if the time slot is 8 to 3pm, it should show as 8.00 to 3.00 pm in that one cell instead of dragged down until the end time.
    It would seem to me you would use a standard type calendar with an entry like "CoolDude 12:00pm -3:00pm" why bother with the time elements down the side.
    Peters calendar is nice but complicated. It might be simpler to just roll your own.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  15. #15
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    After my previous post regarding rolling your own calendar, I started playing around and had an idea I wanted to try.
    Normally I use an array to fill the textboxes with the day number, time, and the event entries for that day.
    It occurred to me that it might be easier to use a dictionary object instead of an array. It only took a couple hours to make the simple calendar attached and I
    thought I'd share it with you to give you some ideas at the very least.

    Double click a date for data entry or editing.
    Attached Files Attached Files
    Last edited by moke123; 12-09-2020 at 12:13 PM.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Adding a Cell Range to a String Variable
    By RunTime91 in forum Access
    Replies: 3
    Last Post: 01-27-2018, 02:38 PM
  2. Clear Cell Range Based on Text in Another Cell
    By Oxygen Potassium in forum Access
    Replies: 3
    Last Post: 08-20-2017, 08:12 PM
  3. get automated email based on calendar time
    By chris007 in forum Access
    Replies: 3
    Last Post: 06-23-2016, 08:30 AM
  4. Replies: 4
    Last Post: 06-18-2013, 08:50 PM
  5. Replies: 1
    Last Post: 05-31-2013, 02:04 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