• Problem with Tab Control? (A2k (9.0.4402) SR-1)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Problem with Tab Control? (A2k (9.0.4402) SR-1)

    Author
    Topic
    #363416

    Problem with Tab Control?

    A2k (9.0.4402) SR-1

    I have the following code in On Click event of a Tab Control (Page Index 0)

    When I click on the Tab, focus does not go to Me!cboLookupSequence

    Me!cboLookupSequence is in the Form Footer

    Private Sub Permit_Information_Click()

    Me!cboLookupSequence.SetFocus

    End Sub

    What am I missing?

    Thanks, John Graves

    Viewing 1 reply thread
    Author
    Replies
    • #554426

      I made a form with a tab control on it and added code to the on click event as you describe and got the result you describe. I even moved the combo box on to the main form. I then put a new combo straight on the tab page and adapted the code as required. Clicking the tab still did not setfocus on the combo box.

      However I discovered that once you have the page selected, move the cursor down on to the page and click. He presto the combo box gets the focus.

      So your first click is in the tab area, which is designated with dotted lines. So this isn

    • #554439

      You normally have to use the Change event of the Tab control to get it to respond the way you want it to.

      • #554981

        Hi Charlotte

        This works, strPermitSuf is detail section of form

        Private Sub Permit_Information_Click()
        Me!strPermitSuf.SetFocus
        End Sub

        This dosen’t work, cboLookupSequence is in the Form Footer

        Private Sub Permit_Information_Click()
        Me!cboLookupSequence.SetFocus
        End Sub

        What am I missing?

        Thanks, John Graves

        • #555090

          Sorry, but are we still talking about tab controls here? I’m having a little trouble understanding what you’re doing. What is strPermitSuf? Is it a control, a subform, or what? If it’s a control or even a subform control, then using SetFocus should work. There’s no reason why you shouldn’t be able to set the focus to a control in the footer using that syntax unless the control in question and the button you’ve clicked are on two different forms (i.e., a form and a subform). Could that be what you’re dealing with?

          • #555210

            This is what I have:

            Form with the following two Tabs Controls and unbound Combo Box in form footer

            Tab A Tab B

            cboLookupSequence (unbound combo box) in the form footer

            Tab A is the main form for Table 1
            Tab B is additional information for Table 1

            This is what I want

            • #555241

              Yes, you’re fighting built-in behavior. When you click a tab, the focus *always* goes to the first control on the tab page. You can’t change that. If you used the GotFocus or Enter event of the first control on the tab page to shift the focus to your combobox, you wouldn’t be able to get the user back to that control. On the other hand, if you stick and unbound control in as the first control on the tab page, lock it and make it zero width, then put code in it’s gotfocus event to shift the focus to the combobox, that should work.

    Viewing 1 reply thread
    Reply To: Problem with Tab Control? (A2k (9.0.4402) SR-1)

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

    Your information: