Sunday, April 04, 2010

Office 2010, part 3

In the Access 2010 Beta, if you open a file from an Explorer window or a shortcut, you get the dreaded

The command or action '' isn't available now.

But the app works perfectly after dismissing that message. This one had me stumped; tried decompile, compile & save, compact & repair; nothing fixed it. Luckily a few minutes of Googling revealed the answer: if you open that same file from within Access you don't get that message.

So then, to prevent that message all you have to do is create a shortcut that launches Access and opens the file, like this (watch for line breaks):

"C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE" C:\mydatabase.mdb

Office 2010, part 2

Today I decided to resolve the Access calendar issue, which is: I have a popup form that uses the Calendar 2.0 control, but Access 2010 does not support ActiveX controls. Yes, I know that starting with version 2007, Access provides a date picker icon that displays wherever you have a text box that has a date format (you can turn that off), but navigating is more cumbersome compared to the old calendar control.

Fortunately the old Access 97 Developer's Handbook has a calendar form which does not use ActiveX, and it does work with Access 2007 and 2010; better still, I emailed the author Ken Getz, and he quickly replied that his code is free to use without any licensing, provided that the credits remain in the modules. His solution is comprised of two forms (the embeddable calendar form, and a calendar test form) and one standard module.

I modified the test form with OK and Cancel buttons & a line of code to replace the form caption with a custom message from a global String variable. Works like a charm! Thanks Mr. Getz.

Now I can retrofit my applications with the new version of my date popup form & have them compatible with Access 2010 when it is released.