Solved

ActiveX Calendar control for Access 2003

Posted on 2010-11-30
10
483 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

734 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