Results 1 to 2 of 2
  1. #1
    JB Guest

    Control addressing on subforms

    I have a subform that contains a bunch of controls (aka color-coded boxes)
    that I want to be able to assign OnDblClick actions to. Other data defines
    color/position of my boxes, but I need to programmaticlly modify what happens

    during the OnDblClick of each box.

    Ideally, I wanted to write 1 macro that I can assign to the control(s) as
    VBA is rearanging the subform. The problem I am having is:

    How can I get the Control Name off of the sub-form? I have tried versions of:
    CurrentObjectName = Application.CurrentObjectName and
    Set ctl = Screen.ActiveControl

    but I keep getting pointed to the main form not the subform. Any
    suggestions on how to tell which control has been clicked on?

    Thanks in advance.

  2. #2
    Join Date
    Dec 2005
    Wilmington, DE - USA

    Re: Control addressing on subforms

    Here's a thought: set up all the OnDblClick event subs so that they call a sub that takes as an argument the control name. That way, you can have each OnDblClick event call that sub, and pass the name of the control that got doubleclicked.

    Does this help?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 10-21-2008, 10:51 PM
  2. Making subforms editable
    By ashiers in forum Forms
    Replies: 7
    Last Post: 10-08-2008, 04:09 PM
  3. Subforms
    By henryclay in forum Access
    Replies: 0
    Last Post: 07-24-2007, 07:51 AM
  4. Sending control to specific control
    By wasim_sono in forum Programming
    Replies: 2
    Last Post: 04-19-2007, 08:19 AM
  5. SubForms to Parent
    By henryclay in forum Forms
    Replies: 2
    Last Post: 10-27-2006, 07:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Other Forums: Microsoft Office Forums