In-built and User Events

R

Rod Plastow

Assume I have an Access form called MyForm. If in another class module I write:

Private WithEvents frmMyForm as Access.Form

I am able to detect all the in-built form events such as On Current, Before
Update, etc.

If however I write:

Private WithEvents frmMyForm as Form_MyForm

then I see only user defined events (or the compiler issues an error message
if there are no such events). Wouldn't it be nice if the latter syntax
enabled both the in-built events and the user events! I prefer the latter
syntax because when coding the auto complete feature of the VBA window gives
me all the properties and methods of the specific form whereas the former
gives only generic values. Also isn't it better to specify a more exact sub
class than a generic class to ensure the correct object type?

I know that I can specify both syntaxes and then set one reference equal to
the other so that I get the best of both worlds or I can raise user events
within the built-in form events in which I am interested. Not having to do
this would be more elegant.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...c5a0c8&dg=microsoft.public.access.formscoding
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top