Results 1 to 9 of 9
  1. #1
    Star Lounger
    Join Date
    Feb 2002
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Set cursor to first field on form upon opening (2000)

    I set my forms to open to a new record, but the cursor doesn't move to the first field (Tab 0) upon opening. My user prefers not to have to tab once to start inputting. I know that I can use SetFocus to put the cursor on the first field, or even SendKeys "{Tab}", but was wondering if there was even a better way. I've looked at all of the settings that I can find, but nothing that does this for me.

    Thanks,

    Randy

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Set cursor to first field on form upon opening (2000)

    First, I need to check that the first field is in the detail section (not the form's header). Assuming it it, you might try adding "Me.SelHeight=1" to your form's OnLoad code. This might help.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

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

    Re: Set cursor to first field on form upon opening (2000)

    The focus on open automatically moves to the first data control in the form's tab order that can receive the focus. Tabs aren't controls in the same sense as data controls. You could use the Open event of the form to set the tab control value to 0, assuming that's the data value of the first tab, but the form should always display the first tab on open. Maybe you need to explain more about your form.
    Charlotte

  4. #4
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set cursor to first field on form upon opening (2000)

    Did you look at the Tab Order in the Design view of the form? On the Access 2000 Toolbar: View/Tab Order. You can make the adjustment here. Recheck that the Tab Index property is Tab Index 0. Also check the Tab Stop property see that it hasn't been set to No. HTH

  5. #5
    Star Lounger
    Join Date
    Feb 2002
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set cursor to first field on form upon opening (2000)

    Thanks for all of the replies. The tab stop is zero for the first field and it's TabStop is set to "Yes". It's not that the cursor appears in the incorrect field when the form opens... it doesn't appear at all. None of the other controls (such as buttons) are Tab Stops. I've looked carefully for what has the focus when the form opens, but can't find anything. Once I Tab or press Enter, the cursor moves into the first field (Tab 0). It's not a crucial thing for me to figure out since I can get it to do what I want, so I don't want to waste everyone's time, but if someone can shed some light on this, it would be interesting to know.

    Thanks again.

    Randy

  6. #6
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Set cursor to first field on form upon opening (2000)

    Do you have a TabControl on the form? If so, focus may be there. Hit the Tab key when form first displays to see where focus moves to; that will help determine where it is now.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  7. #7
    Star Lounger
    Join Date
    Feb 2002
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set cursor to first field on form upon opening (2000)

    Mark,

    Thanks, but it's not that - I don't have a tab control. I cant see where the focus is when it opens, but if I tab or back tab it doesn't ever return to it's unknown location - it toggles between the first and last fields. It's no big deal, I used the SendKeys {Tab} to keep moving forward, but I'm still curious -although it may be one of those 'unsolved mysteries'.

    Randy

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

    Re: Set cursor to first field on form upon opening (2000)

    Are the controls on a subform? I've seen that behavior with a subform because the subform control on the parent form gets the focus but its own first control doesn't until you force it.
    Charlotte

  9. #9
    Star Lounger
    Join Date
    Feb 2002
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set cursor to first field on form upon opening (2000)

    Thanks Charlotte, but there is no subform. Perhaps I will compare all of the properties to another form that works correctly. Also, I've checked to make sure that its not anything in any property events.

    Randy

Posting Permissions

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