Solved

ActiveX Calendar control for Access 2003

Posted on 2010-11-30
10
475 Views
Last Modified: 2012-05-10
One of my new clients it getting a rather strange issue using the AcitveX calendar control (within an Access 2003 database).  I have the control embedded into a form, for scheduling call-backs etc.  However, this client is having issues where they set the required call-back date (on the ActiveX control), but it ends up storing the value as today’s date.  This is an intermittent issue, which none of my other clients have seen/reported in the seven years that it has been shipped (around 1000 units to date on over 20 different sites).  

I've taken a look at the code over the past couple of weeks (which is basic to say the least), I've added delays, DoEvents, Refresh etc - but the problem has still not been resolved. My next port of call (after this), is possibly to get a Third party calendar (something like eXCalendar by eXontrol).

Has anyone ever seen this/similar issue, or have any useful suggestions - I really need to get it resolved (even if it isn't our software).

Thanks as always
0
Comment
Question by:Andy Brown
  • 5
  • 4
10 Comments
 
LVL 9

Expert Comment

by:Ramanhp
ID: 34237761
plz refer http://office.microsoft.com/en-us/access-help/using-the-calendar-control-in-access-HP001121060.aspx

important:

i hope action required in the code is:

Get the date that is currently selected in the calendar >>         dtCriteria1 = StartDateCalendar.Value
0
 

Author Comment

by:Andy Brown
ID: 34237785
Thanks Ramanhp - We are certainly using the .Value part (have been for over seven years) and as mentioned the code is very basic stuff.

Thanks again.
0
 
LVL 84
ID: 34237959
I think you'd be much better off implementing a different method to manage this. While the Calendar control is normally pretty well behaved, you're going to run into trouble (especially as your users move to the newer platforms)

I've always used the API calls from Stephen Lebans (http://www.lebans.com/monthcalendar.htm) but there are several other methods available:

http://www.granite.ab.ca/access/calendars.htm
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:Andy Brown
ID: 34238146
Thanks LSM - appreciated as always.

The main issue (and the reason I was looking at the XCalendar), is that it needs to appear within a form and the layout needs to look the same (otherwise it will cause user-issues / support calls etc).
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 34238524
The link I provided shows several form-based Calendars. You could build the form and embed that as as Subform if needed.

Unfortunately, using ActiveX controls in Access is always an iffy prospect. Using a control that is NOT verified to work in Access is simply trading one set of troubles for another. It looks as is eXcontrol has verified that their controls work in Access, but I'd verify that it works in the newer versions as well. Also, anytime I see a statement like "don't call us for technical support" I wonder exactly what sort of company I'm dealing with :)

If you can show the code where you actually set the value (when the user interacts with the ActiveX calendar) then maybe we can spot something.

What OS is the client running? What version of Access?
0
 

Author Comment

by:Andy Brown
ID: 34238666
The code is quite literally as below.

When you click on the ActiveX control it then changes the date and updates the datGlobal variable.  After the users checks have been run - it uses this variable to update the Call-back date.  Very basic stuff (and it's worked everywhere else).

Various OS from XP to Win7.
DoCmd.OpenForm "Calendar - Schedule activity", acNormal, , , acFormPropertySettings, acWindowNormal
Set frmCal = Forms![Calendar - Schedule activity]
datGolbal=Date() + 1
frmCal.Form.Controls![ctlCalendar].Value = datGlobal

Open in new window

0
 
LVL 84
ID: 34238881
You have a misspelling:

datGolbal = Date() + 1

and you then refer to the variable named "datGlobal"

This may be a typo here on EE, but if this was a direct copy/paste from your project then you should fix that.

Also, when working with Dates, you should use the various Date functions. For example:

datGlobal = DateAdd("d", 1, Date())

I know that many of the Experts here on EE use the syntax you're showing, but it's not the right way to do things.

Finally:

Does your ActiveX control reside directly on the "Calendar - Schedule activity" form? If so, you don't need to refer to the Form:

frmCal.Form.Controls![ctlCalendar].Value

You should refer to it in this manner:

frmCal.Controls("ctlCalendar").Value

0
 
LVL 84
ID: 34238896
Another concerning issue with ActiveX controls:

"Various OS from XP to Win7."

Many ActiveX (i.e. Com) controls that work fine on XP will fail on Win7, especially as your clients move to 64-bit versions. Be aware of this, and start taking steps now to reduce your dependency on ActiveX controls (or move to a different platform, like .NET).
0
 

Author Comment

by:Andy Brown
ID: 34239168
It was a typo at my end (but well spotted).  I'll take a look at the other points.

Incidentally, a couple of the machines are x64 (didn't think of that, will take a look).

.NET - I'd love to move to .NET, but it's a massive undertaking and in truth, the current Access product is good enough to get to a level, where we could get a decent .NET developer (I hope :O).

I'm going to go into the the clients office later in the week and take a look.

Thanks as always - I'll come back to you after that (if not before).
0
 

Author Closing Comment

by:Andy Brown
ID: 34416361
Thanks LSM.

I ended up building my own form based calendar from scratch, Thanks for your guidance (as always)
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

775 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question