Coded Events lost link to Control when copying to a Tab Control 
Author Message
 Coded Events lost link to Control when copying to a Tab Control

When I upgraded to Access '97 I began implementing the use of the Tab Control.  The original form (Pre-Tabs) had
multiple controls on it.  Most of which had code behind them controlling the enabling of buttons and Input Mask
properties.

I did the following process to move these controls to different tab pages:

1)  Selected all of the objects that were to be placed on my first tab page.
2) Cut (Ctrl-X) these objects into the buffer
3)  selected the tab page
4) Pasted (Ctrl-V)  the objects to the page.

RESULT:

None of the object names changed.  But ALL event processing code was no longer linked to the objects.  I had to go into
each control and re-establish the events.

I found it ironic that when I went to the Event tab in the property box I did not see an [Event Procedure].  When I
added it and went to the code... the code was already there.

In addition, it re-set my tab order to a seemingly random order.

after all that explanation... here are my questions:

1) If the code is there for the event, why was it dropped from my control ?
2) Why was the Tab-Order re-set when I placed these objects into my tab control

Regards,
--- Tom Grounds



Wed, 25 Aug 1999 03:00:00 GMT  
 Coded Events lost link to Control when copying to a Tab Control

Quote:
>1) If the code is there for the event, why was it dropped from my control ?
>2) Why was the Tab-Order re-set when I placed these objects into my tab control

When you cut a control form the form it's the same as a copy/delete.
The code becomes unattatched and resides in the General Declarations
area of the form. When you paste the controls it's the same as
createing new ones. They "should" end up at the end of your tab order
(I've never tested this). You could have reattatched the code by again
selecting [Event Procedure] for each event. This implementation is not
ideal, just the way it works. In order to copy and paste a control and
move the code with it, you need to call a maro/function from the
propertysheet itself. Not in the event procedure:

=MyFunction()

The [Event Procedure] glitch can also trip you up if you move from
event to evet while in  module design view. Access doesn't always
create the [Event Procedure]  on the property sheet. You need to move
to form design view and make sure all the events have an entry. I've
been frustrated by this more than once <bg>.

    ...Joe Maki
    MT Kupp & Associates



Thu, 26 Aug 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Can I Copy Controls on a Tab Control to Another

2. VB432 SSTab Control copy controls between tabs

3. Label on MS Tabbed Dialog control prevents validate event firing when changing tabs

4. Tabs losing controls.

5. Help..16 Bit Tab Control Skips Lost Focus Bug

6. Masked Edit COM control appears only on first tab page of tab control in VB.NET

7. Tabbing through controls on a tab control

8. tab control - loading controls onto tabs in runtime

9. Tab control & Control on a tab

10. ActiveX controls losing name when copied

11. How to set the current tab in Tab control of MS COMMON CONTROL

12. Special Tab Control similar to tab control in MS outlook

 

 
Powered by phpBB® Forum Software