Results 1 to 2 of 2

Thread: How to identify the first object that gets the focus in a Form?

  1. #1

    Thread Starter
    Addicted Member Michel Jr's Avatar
    Join Date
    Jan 2000
    Location
    Brazil
    Posts
    175

    Question

    Hi,


    How can I identify the first object to receive the focus
    when a Form is loaded, independently of the TabIndex value?
    Suppose I have 5 Command Buttons in a Form. If the first
    Command Button is disabled, the second Button will be the
    first to receive the focus, despite of its TabIndex value
    is 1.

    Any ideas to solve this?

    Thanks a lot for any help...

    Michel Jr.

  2. #2
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Cleveland, Ohio
    Posts
    263
    In your Form_Load event, put this in at the end:
    Code:
    Show
    Msgbox ActiveForm.ActiveControl.Name
    I hope this is what you were looking for.

Posting Permissions

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



Click Here to Expand Forum to Full Width