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

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Set cursor to first field on form upon opening (2000)

    Author
    Topic
    #373325

    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

    Viewing 2 reply threads
    Author
    Replies
    • #599703

      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.

    • #599704

      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.

      • #599710

        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

        • #599768

          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.

          • #599772

            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

        • #599850

          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.

          • #599930

            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

    • #599705

      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

    Viewing 2 reply threads
    Reply To: Set cursor to first field on form upon opening (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: