My Assistant
![]()
Custom Search
|
![]() ![]() |
![]() |
![]() Post#1 | |
UtterAccess VIP Posts: 1,741 Joined: 17-June 10 From: Dorset. UK. ![]() | This demo database (A2003) shows how to provide a pop-up calendar form for early versions of Access and a replacement calendar for A2007 and later. The aim of this project was to emulate the pop-up calendar that is already built in for A2007 and later as much as possible but also to provide the calendar for earlier versions which do not have this facility available. This calendar has the advantage that extra facilties can be added by the developer, which is not possible with the built in version, and also the method of choosing a month and/or year is done with two combo boxes which is more convenient when entering dates that are several years in the past. The screen shots below show some typical examples of the calendar displayed with Single and Continuous type forms. It has been tested with A2003, A2007, A2010 and A2013 on Windows XP and Windows 7 (but not Windows 10) and should work on most versions of Access and Windows. The .pdf file provided explains how to set up the calendar on your own projects. If any bugs found then post back with details. Peter Hibbs. Attached File(s) ![]() ![]() ![]() |
![]() Post#2 | |
UtterAccess VIP Posts: 1,741 Joined: 17-June 10 From: Dorset. UK. ![]() | This Pop Up Calendar is basically the same as Version 1.00 above except that it also has the option to add a time component to the associated date field as shown in the screen shot below. Peter Hibbs. Attached File(s) ![]() ![]() |
![]() Post#3 | |
UtterAccess VIP Posts: 1,741 Joined: 17-June 10 From: Dorset. UK. ![]() | ADDENDUM. To fix a small bug in both pop-up calendars where an error is generated if the date field holds an invalid date (say something like 'Wednesday 26/09/2018'). Please change the VBA code in the Form_Open event of the form frmCalendar as follows :- Replace the line :- CODE Me.txtDate = Nz(gCalCtl, Date) with :- CODE If IsDate(gCalCtl) Then Me.txtDate = gCalCtl Else Me.txtDate = Date Peter Hibbs. |
![]() Post#4 | |
Posts: 4 Joined: 22-July 19 ![]() | Hi Peter - Love the popup, but found a bug - if Access is not on the first screen of a dual screen setup, it throws an error which locks up Access (and seems to lead to some nasty corruption). The error (which I do not want to repeat if I can help it) is along the lines of an invalid value for DoCmd.MoveSize in Form_Open for Form_frmCalendar. I'm assuming the value is too large, but I'll look into it. |
![]() Post#5 | |
Posts: 4 Joined: 22-July 19 ![]() | What do you think of using Form.Move and the co-ordinates of the calling icon? Forgot to mention: Windows 10, Office 365. |
![]() Post#6 | |
UtterAccess VIP Posts: 1,741 Joined: 17-June 10 From: Dorset. UK. ![]() | Hi John, ![]() Yes, this problem with two screens has come up before but as I don't have such a set up, I have not been able to find a solution. If you can fix the problem then I am sure there will be some developers that will be very grateful. If you need any help with the code then just send me a private message. Peter. |
![]() Post#7 | |
![]() UtterAccess VIP Posts: 7,014 Joined: 30-June 11 ![]() | Peter, Just a quick note to confirm it works just fine on Windows 10 as well. Nice job. I can also confirm it works perfectly on A2016 as well. -------------------- Daniel Pineault (2010-2019 Microsoft MVP, UA VIP, EE Distinguished Expert 2018) Professional Help: https://www.cardaconsultants.com Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net * Design should never say "Look at me". It should always say "Look at this". -- David Craib * A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions) |
![]() Post#8 | |
Posts: 76 Joined: 25-November 18 ![]() | I'm going to be using this on all my apps from now on if there was a vote for best app of the year Ths would get my vote Very nice work peter Only thing I have noticed thats not an error but might catch newer users out, I found when two fields are close together The image opens below the other field/caption the solution is to select the image then click arrange on the toolbar then bring to front this will stop it appearing below other captions/fields, this is for the single form image. mick This post has been edited by Mickjav: Sep 5 2019, 03:46 PM -------------------- All open code examples and free projects are only available from: Database Dreams |
![]() Post#9 | |
UtterAccess VIP Posts: 1,741 Joined: 17-June 10 From: Dorset. UK. ![]() | Hi John, What do you think of using Form.Move and the co-ordinates of the calling icon? Interesting idea - I have not actually used Form.Move before but it seems to be very similar to the DoCmd.MoveSize function except that the x and y co-ordinates are calculated differently. The Form.Move co-ordinates are measured from the left and top edges of the MS Access window and the DoCmd.MoveSize co-ordinates are measured from the Container window (which I assume is the parent form). To use the Form.Move function I would need to re-write the code (which would not be a problem) but the question is - would that fix the problem of using the calendar on a dual screen system? Since you have two screens, is it possible for you to test this situation to see what happens (I have no idea how a dual screen system works when used with Access) but if it does work OK then this would be a very useful mod to implement. If it doesn't work then I don't really see much point in re-writing the code just to use a different function. Let me know your thoughts. Hi Daniel, OK, thanks for the update re: Windows 10, that is good to know (it looks like I am going to be forced to upgrade from Win 7 to 10 next year, much against my will!). Hi Mick, Thanks for the kind comments. I am interested to hear about the bug you have discovered, I can't get it to fail in the way you describe though. Perhaps you can provide more details or maybe a demo DB that shows the problem and then I might be able to fix it. Peter. |
![]() Post#10 | |
Posts: 4 Joined: 22-July 19 ![]() | Form.Move does let it open on the second monitor without the error. The issue I'm looking at now is that the window has a scrollbar and the calendar will pop up in the same location on the screen even if the icon has been scrolled to a different location. I can't seem to find a case where anyone has been able to determine the new location of a control after scrolling. It might take a Windows API, but that's a bit out of my experience. Thinking about this again, I believe it was working for DoCmd.MoveSize so maybe I need to go back to the adjustments you had for that... This post has been edited by JohnAnder905: Sep 6 2019, 08:10 AM |
![]() Post#11 | |
Posts: 4 Joined: 22-July 19 ![]() | A little more information: it's the offsets that cause the application to lockup; DoCmd.MoveSize without the offsets throws an error, but the frmCalendar does open (just on the primary monitor instead of the secondary monitor). The error thrown is attached. ![]() May have spoken too soon - now it's locking up even without the offsets. Hope I'm not rambling too much, but it looks like GetMonitorInfo comes into play in addition to (or instead of?) SPI_GETWORKAREA. This post has been edited by JohnAnder905: Sep 6 2019, 09:09 AM |
![]() Post#12 | |
Posts: 76 Joined: 25-November 18 ![]() | Hi Peter QUOTE Thanks for the kind comments. I am interested to hear about the bug you have discovered, I can't get it to fail in the way you describe though. Perhaps you can provide more details or maybe a demo DB that shows the problem and then I might be able to fix it. When I Copied image to my db i had to set the bring to front as It was behind another control this may have just been my system And have made sure there is enough space now but when I copy the image I always make sure I bring it to front I use it an all the date fields on left middle ![]() -------------------- All open code examples and free projects are only available from: Database Dreams |
![]() Post#13 | |
UtterAccess VIP Posts: 1,741 Joined: 17-June 10 From: Dorset. UK. ![]() | Hi John, I have sent you a private message with a test database file. Hi Mick, I don't really know why it fails but if I come across any reason for it, I will let you know. Peter. |
![]() Post#14 | |
Posts: 76 Joined: 25-November 18 ![]() | It doesn't fail I just had to set the image so it is in front off others like below: ![]() -------------------- All open code examples and free projects are only available from: Database Dreams |
![]()
Custom Search
|
![]() | Search Top Lo-Fi | 14th December 2019 - 06:47 AM |