Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Dubai, UAE, United Arab Emirates
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lost Event Associations (Access 2003)

    G'day All

    I've builta form with a bundle of events on various controls - typically some controls have four events. The form became cluttered as the requirements for more controls revealed themselves. So I decided to group them and use a tab control. I made the tab control, then cut and pasted the relevant controls onto the various tabs. However I subsequently discovered that I've lost the event links on all the controls. The VBA code is still there, but none of the controls I cut and pasted now refer to the vba event procedures. I am now laboriously going through to work out which controls have what event code and re-instating the links. The usual close and open, database repair options have not worked.

    Is there a faster way to recover? Why did I lose the links? Also - is there a way to programmatically select which tab is displayed when the for opens?

    Regards Ken

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Lost Event Associations (Access 2003)

    I don't know of a fast way to reassociate events with event procedures.

    To select a tab page programmatically, set the Value property of the tab control. This value is the zero-based index of the active tab page, so the first page corresponds to Value = 0 etc. To activate the third page of a tab control named tabPages, use

    Me.tabPages.Value = 2

  3. #3
    2 Star Lounger
    Join Date
    May 2002
    Location
    Dubai, UAE, United Arab Emirates
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Lost Event Associations (Access 2003)

    Thanks. I guess I'll set some constants to keep the tabs straight.

  4. #4
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Leuven, Vlaanderen, Belgium
    Posts
    322
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Re: Lost Event Associations (Access 2003)

    Isn't it as quicky/handy solved by 'clicking and restoring' the event properties in the property dialog manually? If this is a situation which won't occur anymore in the future, if you remember which type of events occur with which controls and the control names aren't changed, I'ld think Access will automatically link the right procedures again to the right controls as the code is still there in the module...

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Lost Event Associations (Access 2003)

    When you cut controls and paste them onto tab pages you lose the connection to the event procedure just as you do if you cut control and move them from detail to header or footer section, or vice versa. You can restore the connections by cutting the code in the module and pasting it back in.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •