• Tab Controls

    Author
    Topic
    #352465


    Hope I can explain this properly…

    I have a tab control with several pages, each recording actions and dates. Its a kind of diary application. When a user adds a record in one of the pages and adds a date, certain other fields are automatically updated.

    It all works perfectly if a user presses enter after keying data into the last field before moving to another page, but if they don’t exit the last field but just move focus off the form, the afterupdate action for the last field does not work.

    I have tried all the usual suspects ie Lostfocus on the form, but to no avail.

    Any suggestions?

    Caz

    Viewing 0 reply threads
    Author
    Replies
    • #512711

      Could you force the key press using On Exit SendKeys, {Enter}? Not sure?

      • #512740

        Have tried the sendkeys {Enter} but doesn’t help. Only when the user closes the main form does the exit of the tab control occur, so I’m going to do an event here that sorts out the problem. It’s not great but I think it may be a feature of using tab controls rather than a normal sub form.

        Thanks anyway.

        • #512785

          If they’re clicking on another tab, you have a couple of choices. The minute the user clicks outside the subform, the Exit event of the subform control is triggered, and you could try using that to test for a dirty condition in the subform and if that test is true, saving the subform record. Another option is to use the Change event of the tab control itself. That happens whenever a tab is clicked, so that might be useful to you as well.

          • #512879

            Thanks for the input

            My problem is now resolved, I put a msgbox on some of the events to find out when they occured. I found the after update for the form worked, but I was referring to fields using the me. whereas my focus had moved so I think this was the real problem after all.

            I tweaked my code and it’s all working fine now – phew this was driving me mad.

    Viewing 0 reply threads
    Reply To: Tab Controls

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

    Your information: