Results 1 to 6 of 6

Thread: Tab Controls

  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Location
    Wirral, Merseyside, Merseyside, England
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tab Controls

    [img]/w3timages/icons/laugh.gif[/img]
    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

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Controls

    Could you force the key press using On Exit SendKeys, {Enter}? Not sure?[img]/w3timages/icons/nuts.gif[/img][img]/w3timages/icons/nuts.gif[/img]

  3. #3
    Star Lounger
    Join Date
    Feb 2001
    Location
    Wirral, Merseyside, Merseyside, England
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Controls

    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.

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

    Re: Tab Controls

    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.
    Charlotte

  5. #5
    Star Lounger
    Join Date
    Feb 2001
    Location
    Wirral, Merseyside, Merseyside, England
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Controls

    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.

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

    Re: Tab Controls

    Glad you found a solution!
    Charlotte

Posting Permissions

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