UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
15 Pages V < 1 2 3 4 > »   (Go to first unread post)
   Reply to this topicStart new topic
> Ms Outlook Style Calendar For Access Projects, Access 2003    
 
   
Peter Hibbs
post Jun 26 2018, 02:22 PM
Post#21


UtterAccess VIP
Posts: 1,741
Joined: 17-June 10
From: Dorset. UK.


Hi dulcmr7,

Thank you for your kind comments, they are much appreciated.

Regarding the positioning of the pop-up calendar form on multiple monitors, this is a problem. I don't have monitors like this so I can't really try to find a fix, although I am sure it must be possible. As you suggested, you probably need to add some offset values for the horizontal and vertical co-ordinates in the sub-routine to get the form to appear in the correct position but I don't know what these would be. I guess you could experiment with code in the btnStartDate_Click() event to see what happens. I would move the calendar to another screen and then add some extra twips to the x1 and y1 variables just to see if that will move the form but other than that I can't really help.

One possible option you could try is, if you are using Access 2007 or later, you could use the built-in Access pop-up calendar. If you make the btnStartDate control invisible, change the Enabled and Locked properties of the txtDate control to True and False respectively and make sure the Show Date Picker property is set to 'For dates', this might be acceptable. You would also need to add this line of code , CalendarUpdate to the AfterUpdate event of the txtDate control so that the calendar form updates when you choose a new date. You could probably also add some code to move the focus after the update to highlight the selected date, etc.

Since this calendar uses a Continuous type form for the dates, it is not possible to use the Can Grow parameter (that only works on reports) so the only thing you could do to show more appointments in each date cell is to make the controls taller on the sub-form which will make all the rows taller. I guess it depends on the size of your screens as to whether this will work OK.

To remove the Sunday and Saturday columns on the Monthly calendar would require a major change to the VBA code and would take a lot of effort. I suggest that you make those columns very narrow, perhaps just enough to show the day as Sun and Sat and then make the other days of the week wider. In this way you still have the display for the weekend dates, in case you ever needed them, but it would provide more space for the working days. Changing the control sizes will still be quite a bit of work but would be easier than rewriting a lot of code.

Sorry I can't be of more help but let us know how you get (especially if you solve the multiple screen problem as other users have mentioned the sam eissue to me).

Peter Hibbs.
Go to the top of the page
 
dulcmr7
post Jun 26 2018, 06:57 PM
Post#22



Posts: 4
Joined: 30-May 18



Thanks for the quick reply Peter and for your thoughts.
I will look at the btnStartDate_Click() code tomorrow to see if I can get the calendar pop-up to work correctly. I think you are correct, though, I could probably just use the Show Date Picker property that is now available and use the built-in options. That sounds a lot easier to me!

I'll have to give my dilemma with the form appearing correctly some more thought on how I want to handle that. Thanks for reminding about the Can Grow property not working in continuous forms.

I feel like I'm so close on the Weekday only thing. I was looking at that this afternoon.
Unless I'm misunderstanding something, I think what you propose would only hide the weekends, but data would still be written to the tables for those days. I am wanting to not even write anything to the tables for Saturday or Sunday.
Here is the code I have modified (in bold). This is in the Module modCalendarCode under the Sub ShowMonthAppts. I have added a variable called vOffset and if the new calendar entry lands on a weekend, it is supposed to offset that particular day and future ones by 1 or 2 days:

CODE
          vOffset = 0
            'Now copy appt info into each row in array
            Do                                                                  'do--
                vCol = Weekday(vDate, conFirstDay) - 1 + vOffset               'calc column No for current date
                vRow = (DateDiff("d", vFirstDate, vDate) \ 7)                   'calc row number for current date

               If vCol = 6 Then
                    vCol = 1
                    vRow = vRow + 1
                    vOffset = vOffset + 2
                ElseIf vCol = 0 And vOffset = 0 Then
                    vCol = vCol + 1
                    vOffset = 1
                End If
                
                If conMonthHide = 0 Then                                        'if current date <> current month then skip *** (hide appts for dates not in current month)
                    If vRow <= 6 Then
                        vArray(vCol, vRow) = vArray(vCol, vRow) _
                        & Nz(rst!Subject) & vbCrLf                                  'add appt data to array + CRLF
                    End If
                Else
                    If Month(vMonthStart) = Month(vDate) Then                   'if current date <> current month then skip *** (hide appts for dates not in current month)
                        vArray(vCol, vRow) = vArray(vCol, vRow) _
                        & Nz(rst!Subject) & vbCrLf                              'add appt data to array + CRLF
                    End If
                End If
                vDate = vDate + 1                                               'inc date ref
            Loop Until vDate = vDateStop                                        'until all cells filled
            rst.MoveNext
        Loop



It almost works. I think I know what's wrong, but I'm struggling to fix it. Maybe I'm taking the wrong approach altogether?
It actually does work for the actual month that the appointment takes place in. The weekends are blank and the rest of the appointment is moved out the 1 or 2 expected days. But if the appointment is in the "preview" or grayed out section for the next month (e.g. If the appointment is in the first weekend of March I can see it in the grayed out section at the bottom of February's calendar) then it gives me the warning that the "Subscript is out of range" (when viewing the February calendar in the previous example). I am guessing that is because I am moving days on the appointment forward that it is wanting to assign these values to the array beyond the set size of the array itself. I have been trying unsuccessfully to stop assigning values to the array within the Do loop, but no luck so far.
Sorry for the rambling. Hopefully something made sense.

Edit: I have tried setting conMonthHide=1 to hide the preview for the next month thinking that would solve my issue. It didn't.
My new theory is that I am having trouble with the modified code when the appointment spans over the end of the month in general (e.g. from 7/19/2018 - 8/7/2018).
This post has been edited by dulcmr7: Jun 26 2018, 07:42 PM
Go to the top of the page
 
Peter Hibbs
post Jun 27 2018, 03:35 PM
Post#23


UtterAccess VIP
Posts: 1,741
Joined: 17-June 10
From: Dorset. UK.


Hi dulcmr7

Having looked at this again I think there is an easier way to do what you want regarding the requirement to only show the working week days. Basically you can just delete the Sunday and Saturday controls from the Month sub-form and change a few lines of code and this should work.

I have sent a demo version which shows the days Monday to Friday on the form (I haven't bothered to resize them but you can easily do that if you wish). Also, I haven't made any changes to the Weekly view so if you are using this as well then you will need to do something similar here as well. The Daily view should not need any changes.

So what happens is that the days of the week are shown as normal but in the pop-up Appointments form, you just need to prevent the users creating an appointment for a Sunday or a Saturday and that is pretty much it (unless there is some other factor that you have not told us about).

In the attached version I have marked any code changes or additions with ??? characters so you can search the VBA code for those to see the changes. The only change to the controls design you need to make is to the cmdDay button on the Month sub-form, it is a transparent button which runs along the top of the date cells (those colored green) so you will need to change the size of that button so that it covers the date cells for Monday to Friday. If you don't then you will probably show the wrong date when you click on a green date cell.

Anyway, try it out and let us know what you think.

Peter Hibbs.
Attached File(s)
Attached File  Outlook_Style_Calendar_V3n.zip ( 182.01K )Number of downloads: 119
 
Go to the top of the page
 
dulcmr7
post Jul 2 2018, 07:32 AM
Post#24



Posts: 4
Joined: 30-May 18



Hi Peter -
I just wanted to follow up and say THANK YOU for your suggestions and start of the new code. Your method was much better than how I was trying to manipulate it.
My only hangup was I was needing to calculate the number of working days an appointment was scheduled over. If it went multiple weeks, it is still putting data in for Saturday and Sunday. I just did a quick calculation in a query to remove those from the count and all is well in my world once again.

Thank you so much for your help and support!
Go to the top of the page
 
Peter Hibbs
post Jul 2 2018, 08:34 AM
Post#25


UtterAccess VIP
Posts: 1,741
Joined: 17-June 10
From: Dorset. UK.


Hi,

yw.gif

Peter.
Go to the top of the page
 
riti90
post Sep 11 2018, 04:32 AM
Post#26



Posts: 14
Joined: 11-January 18



Dear Peter,

I hope you are well,
I'm new to the forum and Access too, and I would like to ask if you could help me with this topic?
I'm trying to make it as a booking system for my company for booking Chamber times.
I've added a Combobox to filter it but I find it difficult to do so.
Attached File  chamber.jpg ( 133.68K )Number of downloads: 31


Could you please give me a hand with that.

And I also would like to ask if we can make it to stop overlapping the Chambers too.

Thank You in advance,
Margarit
Attached File  Outlook_Style_Calendar_V3_n_.zip ( 275.37K )Number of downloads: 42

This post has been edited by riti90: Sep 11 2018, 04:36 AM
Go to the top of the page
 
Peter Hibbs
post Sep 11 2018, 10:38 AM
Post#27


UtterAccess VIP
Posts: 1,741
Joined: 17-June 10
From: Dorset. UK.


Hi Margarit,

welcome2UA.gif

I would be happy to help you with this but before I start making a lot of changes to your version I have a couple of questions.

I have already made some modifications to the original version which does more or less what you are asking for which I have attached. I have used the name 'Category' for the extra field but you could change that to Chambers (or whatever) for your own database. Perhaps you could have a play with this version and see if it does everything you want.

I notice that on the database you posted you are using the version that allows for 'recurring appointments' which is not provided on the attached version, do you need this facility in your database (you haven't actually made any recurring appointments in your example)? If you do, then we will need to add that facility into your version which is bit more complicated.

You also want to 'stop overlapping appointments' which I guess means that you want to be able to schedule more than one appointment in the same time-slot! If so, then you should open the module modCalendarCode and change the constant called conMultiAppts at the top of code window from 0 to 1 (as explained in the User Manual). If this is not what you meant then please explain further.

Anyway, let me know your thoughts and we can go from there.

Peter.

P.S. As this post is not directly related to a problem with the original version you may find that the UtterAccess gnomes will move these posts to a separate thread.
Attached File(s)
Attached File  Outlook_Style_Calendar_V3m.zip ( 156.01K )Number of downloads: 51
 
Go to the top of the page
 
riti90
post Sep 12 2018, 01:53 AM
Post#28



Posts: 14
Joined: 11-January 18



Hi Peter,

Thank You so much, this is a great solution.
I was working yesterday on the first file and I ended up with something like this :

Attached File  Outlook_Style_Calendar_V3o.zip ( 447.31K )Number of downloads: 40


But Your one is much more completed.

I would like to ask if we can add the All Day event when booking a Chamber for example.
Because the most of the time they are booked by days, ans sometimes by hour.

Once again Thank You very much for your help,

Regards,
Margarit
Go to the top of the page
 
riti90
post Sep 12 2018, 09:00 AM
Post#29



Posts: 14
Joined: 11-January 18



Hi Again,

Sorry to bother again but I'm working on this calendar and trying to create a Yearly calendar.

If it's OK with you Could you please have a look at that one cause I'm stuck now and don't know how to proceed.


Attached File  Outlook_Style_Calendar_V3o.zip ( 764.99K )Number of downloads: 48


Thank You,
Margarit smile.gif
Go to the top of the page
 
Peter Hibbs
post Sep 12 2018, 01:26 PM
Post#30


UtterAccess VIP
Posts: 1,741
Joined: 17-June 10
From: Dorset. UK.


Hi Margarit,

WOW, it looks like you have put a lot of work into adding the Yearly calendar and it is quite impressive, the VBA code is all completely wrong but at least you have done the hard work with all the extra tabs, fields, etc.

You can't just copy the code for the Monthly view, change a few variables and then expect it to work for the Yearly view. For example, if you look at the dates you have for the Yearly view you can see that they all just follow on for each row of the form so by December they are about 9 days out. You have to reset each row after each month and start again from day 1. Having said that, there is a much easier way to do this - you already know the Date field names because they go from Day1Date to Day31Date and you know the row numbers because the row numbers are the same as the Month numbers (1 to 12) so you can create the individual field names from those variables and insert the dates from your yDate variable into the calculated field name. You just need to know the year so that you can stop the loop when the count reaches the following year. For example, the code below does just that (which you can test yourself if you want) :-
CODE
    yFirstDate = DateSerial(Year(yYearStart), 1, 1)                                 'calc first date on selected calendar DateSerial(Year(yYearStart), 1, 1)

'Calc cell dates from starting date and copy to table
    yDate = yFirstDate                                                              'vDate = first date on calendar
    CurrentDb.Execute "UPDATE tblYearData SET Day29Date = NULL WHERE RowNo = 2"     'clear date 29 Feb in case previous year was a leap year
    Do
        CurrentDb.Execute "UPDATE tblYearData SET Day" & Day(yDate) & "Date = #" _
        & Format(yDate, "yyyy/mm/dd") & "# WHERE RowNo = " & Month(yDate)           'insert current date into Day(nn)Date field
        yDate = yDate + 1
    Loop Until Year(yDate) = Year(yYearStart) + 1                                   'loop until yDate moves to the following year


However, the rest of the routine needs to be rewritten because it does not work how you have done it for all sorts of reasons. I will do that as it is quite an interesting project but it could take a while because I have other projects to attend to at this time. I propose to get the Yearly mode working first and I will upload it so that you can have a look and then if that is OK I will look at adding in the option to choose a Chamber as you requested initially. As a matter of interest, what is this database for, what are these chambers and will you ever want to add a Chamber 3 or 4 or whatever?

Anyway, I will get back to you when I can, just be patient but if you have any questions then feel free to post them here.

Peter.
Go to the top of the page
 
riti90
post Sep 12 2018, 02:13 PM
Post#31



Posts: 14
Joined: 11-January 18



Hi Peter,

I would like firs to thank you for your help and Thank You for getting back to me.

We use there chamber for some device testing we do, and we need to do device conditioning in those, so yes there are going to to more then 2 chambers added.
The one that you showed me with the Categories is just fine for me, the only think I'm on now is this yearly calendar.

I would be grateful if you can help me with that, whenever you've got some time.

Best Regards,
Margarit
Go to the top of the page
 
Peter Hibbs
post Sep 13 2018, 06:06 AM
Post#32


UtterAccess VIP
Posts: 1,741
Joined: 17-June 10
From: Dorset. UK.


Hi Margarit,

I have given some thought to this database and I am wondering if there is a better way to show the Yearly data.

With your current method you have very small fields for the data so you will only see part of one or maybe two records for any date and you will also need to scroll the form horizontally (and probably vertically) to see all the dates in the year.

My suggestion would be to show all the dates for the current year on the form (see screen shot below) and color the dates that have any data stored. This has the advantage that you can see all the dates together without having to scroll the form. In this example you can just click on a date to see the contents of the record in the List box and you can click on a record in the List box (if there is more than one) to see the data in the various fields in the Details box. Also you could use other colors to highlight certain dates if that would be useful in the database.

Anyway, let me know what you think. It is up to you to decide (it makes no difference to me, I will go along with whatever method you prefer).

Peter.
Attached File(s)
Attached File  Calendar1.png ( 31.58K )Number of downloads: 54
 
Go to the top of the page
 
riti90
post Sep 13 2018, 06:45 AM
Post#33



Posts: 14
Joined: 11-January 18



Hi Peter,

That one looks great, it's more clear than the other one.
we could go with that is it's OK with you. smile.gif

Best Regards,
Margarit
Go to the top of the page
 
riti90
post Sep 14 2018, 09:08 AM
Post#34



Posts: 14
Joined: 11-January 18



Hi Again Peter,

Sorry to be a pain.

I just wanted to let you know that I've been doing some small things on that file.
I'd be happy to hear any feedback from you about it. smile.gif

Attached File  Outlook_Style_Calendar_V3_WIP03.zip ( 307.19K )Number of downloads: 76


But I still like your last version the most really, the one that you showed me the picture from. smile.gif

Thank You,
Looking forward to hearing from you soon.

Regards,
Margarit
Go to the top of the page
 
Peter Hibbs
post Sep 14 2018, 01:28 PM
Post#35


UtterAccess VIP
Posts: 1,741
Joined: 17-June 10
From: Dorset. UK.


Hi Margarit,

Well, that looks pretty good, you have obviously managed to add in the options to have the Chamber categories showing separately or all together which works pretty well.

I see you have used Allen Brownes' pop-up calendar as well. Why is that? Do you prefer this instead of the Access built-in calendar (I assume you are using Access 2007 or later)? I usually replace the Access calendar with my own design (which is similar to Allen Brownes' version) so I can do that or I can use the Allen Browne version if you prefer. You can find a demo HERE.

You said earlier that you are new to Access but I suspect you know a lot more than you are saying, especially with the VBA programming side!

Anyway, I have been adding the Yearly view mode, as promised, which is nearly finished and I have added this facility to the Appointments version that also allows recurring appointments (I know you only wanted the option to set an All Day appointment but as this part is an integral part of the 'recurring' code it was easier to include the whole lot rather than try and extract that part).

Will get back to you when I have something to upload.

Peter.

Go to the top of the page
 
riti90
post Sep 14 2018, 01:50 PM
Post#36



Posts: 14
Joined: 11-January 18



Hi Peter,

Thank you very much for your feedback. It means a lot really.
Well I know a few things about access and VBA that I've been self taught, but nothing more.
Just trying to learn and improve more.
About the calendar, I just used it to make a difference rather than necessity, I had it in one of my databases. But if it's OK with you you can use your pop up calendar in the new file. smile.gif

Once again thank you so much for your help.

May I ask another question please, is it any chance we can color code the chambers so each chamber looks different? If it is an easy fix than ok, if not don't worry about it.

WlI wish you a great weekend,

Regards,
Margarit
Go to the top of the page
 
Peter Hibbs
post Sep 14 2018, 03:09 PM
Post#37


UtterAccess VIP
Posts: 1,741
Joined: 17-June 10
From: Dorset. UK.


Hi Margarit,

May I ask another question please, is it any chance we can color code the chambers so each chamber looks different? If it is an easy fix than ok, if not don't worry about it. Hmmm.. do you mean like THIS?

If so, do you also want the color coding on the Weekly and Daily views?

Do you even need the Weekly and Daily views?

Peter.
Go to the top of the page
 
riti90
post Sep 14 2018, 03:33 PM
Post#38



Posts: 14
Joined: 11-January 18



Hi Peter,

Thank you for your response.

Yes, that one is perfect. I'd be very happy if the Weekly and Daily views are included as we may need to book a chamber for only a few hours or days sometimes. It could be nice if color coding is in these views But it's not really a MUST. If it is too much of a hustle I'd just leave it. smile.gif smile.gif

Ps: I'm currently using Ms Access 365 x64 smile.gif

Regards,
Margarit smile.gif
This post has been edited by riti90: Sep 14 2018, 03:35 PM
Go to the top of the page
 
Peter Hibbs
post Sep 18 2018, 03:31 AM
Post#39


UtterAccess VIP
Posts: 1,741
Joined: 17-June 10
From: Dorset. UK.


Hi Margarit,

Just an update for you, I have nearly finished the modifications you requested (sorry for the delay, it took longer than I thought) and I will probably upload the new version in the next day or so.

I do have some questions though :-

(1) What sort of text will you be entering on the Monthly calendar? In your vesrion you have just put 'Chamber 01', 'Chamber 02', etc but is this what you will use in the working version or is it just an example?

(2) What will be the maximum number of chambers you will need eventually? You can show about 5 lines in a date field on the Monthly calendar but if you need more you might want to change the size of the fields to show more lines (depending on your screen size).

(3) I am wondering about the table scheme for this database, is the calendar going to be used only to show the chamber usage (for example, which chambers are in use for each date) or is going to be used to show details of the tests that are being done using these chambers? If you are storing details of the tests then I would think you would need another table to store that information (unless you are already doing that). It might be helpful if you could give us a bit more detail on how the whole database works.

(4) Can you confirm that you are using the 64 bit version of Access. If so then you may need to make some changes to the next version because it will use some API calls to show the Color picker utility which needs changing slightly for 64 bit versions.

(5) Is this database being used by more than one user on a different computers via a Network or is it being used on a single computer? In either case you will need to split the file into Front-End and Back-End files (or maybe you already have this set up).

Anyway, let me know the answers to the above when you can.

Peter.
Go to the top of the page
 
riti90
post Sep 18 2018, 03:47 AM
Post#40



Posts: 14
Joined: 11-January 18



Dear Peter,

Thank you for your response. smile.gif

The answers to your questions are as below:

(1) I've used Chamber 01 or Chamber 02 as examples really, the chambers have different names and conditioning options(I'm focused only on the names, not the conditioning options).

(2) There are more than 5 chambers and we may but more in the future but if I need to change the size of the fields then it's OK, I'll do it considering all the names.

(3) the Calendar will be mostly for chamber use only, and we can add notes of what is it being user for. I'm using different databases for the tests for the moment.

(4) Yes we are all using 64 bit version of Access but I can make the changes for the API calls.

(5) The database will be used on Network by different users so I'll have to split it up.

Thank you for your help,
Regards,
Margarit
Go to the top of the page
 
15 Pages V < 1 2 3 4 > » 


Custom Search


RSSSearch   Top   Lo-Fi    15th December 2019 - 10:43 AM