Consulting

Results 1 to 4 of 4

Thread: Quick question

  1. #1
    VBAX Regular
    Joined
    Mar 2005
    Posts
    67
    Location

    Quick question

    Hey guys,
    How one control test if another control on my form has focus?

  2. #2
    VBAX Newbie
    Joined
    Mar 2005
    Posts
    3
    Location
    If Me.[ControlName] some test Then

    Some action

    End If


    Providing the controls are on the same form.

  3. #3
    VBAX Regular
    Joined
    Mar 2005
    Posts
    67
    Location
    Soo... what would this "some test" be?

    I know how to reference a control, i need to know how to test if it has focus.



    Thanks
    Mikw

  4. #4
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Try ..

    [VBA]If Me.ControlName Is Me.ActiveControl Then[/VBA]
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

Posting Permissions

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