views:

225

answers:

1

Short version of question:

How can I author custom controls for MS Access 2003 without resorting to VB6 ?

Long Version:

I have been spoiled with the pleasure of writing C# WinForms apps for the past 6 years and now I have to modify an Access 2003 application. Yes, it will eventually be rewritten as a Dot Net app, but for now, it must remain an Access 2003 application.

So one of the things I loved about writing WinForms applications is that I could take any WinForms UI object, say a combobox and turn it into a custom control to which I could add features. I could also take multiple controls, composite them onto one design surface as a custom control and then have it appear in my VS.Net toolbox as a custom control. (Very handy when you have a complex set of data gathering controls you need to use over and over again).

So now that I am stuck with Access 2003 for one of my projects, I want to be able to create custom controls for it. Access 2003 3rd party controls use COM. The problem is, the only environment I've ever created custom COM UI controls in is VB 6. Now, I still have VB6, but since VB6 is more than 10 years old now, I feel obligated to search for other options.

I'm pretty sure that there are people still authoring COM UI controls, so what are you guys using if not VB6 ?

+1  A: 

I doubt you're going to get much help on this specific to Access, as most Access developers don't need or desire what you're asking for. Indeed, most of the pros that I hobnob with avoid non-native controls of all types in Access, simply because there are so many problems associated with using them in an Access application. Access is actually a very special animal in many ways so creating controls that will work in Access is harder than creating ones that work in a VB app, for instance. I don't know this for a fact, my guess is that one reason for this is that fact that individual controls on an Access form have a window handle only when they have the focus. The reason for this is quite clear: at the time Access was designed, system resources were limited and you didn't want to be allocated window handles for every single control on a form (which could be in the 100s). That's perhaps not an issue these days, but the design in Access remains the same. There are workarounds, but from my observation, they aren't pretty.

David-W-Fenton
FMS Inc. has been developing custom controls for MS Access since the Access 2.0 days.http://www.fmsinc.com/MicrosoftAccess/controls/new-features.aspSo I know there is a way to do this and do it well.
Craig L
Well, sure -- I didn't say it was no possible, just that it's harder than you might suspect. FMS specializes in Access products so it shouldn't be surprising that they've built sufficient expertise to know how to handle the problems that come with building Access controls. But they are one of the few such organizations out there, and given how widespread the use of Access is, it suggests to me that it may be a harder task than most people want to attempt (at least, those who use Access).
David-W-Fenton
+1 though I think maybe Access folk don't want they because they can't easily have them. Agreed Forms in Access are beasts unlike forms in other applications: I haven't used them too much but from my perspective they seem to work more like a report writer. Clever, I suppose, but they don't lend themselves to being extensible.
onedaywhen
You might be surprised at how extensible they actually are. You might want to browse Stephen Leban's code examples for some pretty clever coding using Access in some amazing ways: http://www.lebans.com/products.htm
David-W-Fenton
Well, sure -- I didn't say it was not possible, just that it's harder than some folk might suspect :)
onedaywhen
Touché! :)
David-W-Fenton