WithEvents Missing?

WithEvents Missing?

Anonymous
Not applicable
292 Views
4 Replies
Message 1 of 5

WithEvents Missing?

Anonymous
Not applicable
I have a variable in a Class Module declared as:

Dim WithEvents txtCell As TextBox

I need to use the Exit and/or BeforeUpdate Events, but these (and the Enter
and AfterUpdate) Events are not available to this variable.

How can I get these Events?

Note: I've checked in VB5.0 and Access 2000 VBA, and their TextBox has the
LostFocus and GotFocus Events available to a WithEvents variable.

Note: Acad 2002 VBA has the generic object Control that has only the 4
"missing" Events. Is this a coincidence? I tried assigning the TextBox to a
Control variable, but I get "Error #429 - object or class does not match the
set of events"

Does anybody know what's going on here??
0 Likes
293 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
DC Deno had this to say:

> I have a variable in a Class Module declared as:
>
> Dim WithEvents txtCell As TextBox

Simply placing a textbox on a form will give you access to all of it's
methods and properties. What's the deal with the global variable?

--
http://www.acadx.com
"If you want to be somebody else change your mind"
0 Likes
Message 3 of 5

Anonymous
Not applicable
Yes, I have used a TextBox that way before, but I want to create an
unlimited number at runtime so I can have a table whose cells are edittable
in place, and appearance can be controlled seperately. The cell might also
be a ComboBox or a ToggleButton or a graphic etc.

This is not an unreasonable thing to do, is it?
0 Likes
Message 4 of 5

Anonymous
Not applicable
DC Deno had this to say:

> Yes, I have used a TextBox that way before, but I want to create an
> unlimited number at runtime so I can have a table whose cells are
> edittable in place, and appearance can be controlled seperately.
> The cell might also be a ComboBox or a ToggleButton or a graphic
> etc.
>
> This is not an unreasonable thing to do, is it?

You will certainly be stretching the limits of what VBA is designed to
do. Are you sure you wouldn't be better served with a profesionally
designed grid control?

--
http://www.acadx.com
"If you want to be somebody else change your mind"
0 Likes
Message 5 of 5

Anonymous
Not applicable
I gave up trying to find controls that will do what I want, but I am open to
suggestions
0 Likes