Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SetFocus and its Fallout (A2K)

    I have a form where when loading this form, I do the following:

    Private Sub Form_Load()
    Me.txtStartHere.SetFocus
    End Sub

    I do this in order to keep their sticky little fingers away from data fields on opening a form so that they don't accidentally hit a space key or something and destroy the data in that field. And this seems to do the trick.

    However, if they open the form and

    a) Press a designated function key to create a new record, I get "System can't move the focus to the control txtBox."

    Or

    [img]/forums/images/smilies/cool.gif[/img] If they try to tab to the first field after opening the form, they have to hit Tab twice.

    Would appreciate any help,
    Cheers,
    Andy

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

    Re: SetFocus and its Fallout (A2K)

    As an alternative, you could put an unbound text box in the detail section and make it first in the tab order of the form. You won't need code then.

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SetFocus and its Fallout (A2K)

    Duh!!!

    Don't you just sometimes hate the forest for the trees that are in the way.

    Thanks, Hans,
    Cheers,
    Andy

Posting Permissions

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