Have lost control-Please help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dbar10
    New Member
    • Nov 2008
    • 17

    Have lost control-Please help

    In my main form I have a [LastName] field that I can scroll with my mouse to advance to any name. I have put code in this field so that On Lost Focus the cursor moves to a new record in subform [UnitsWorkedQuer y subform]. My problem is I can't click back on the LastName field and scroll because the scroll function is remaining in the subform. How can I regain control? Thanks

    Part 2: I tried moving the above command to AfterUpdate but now my code will not take me to the new record, it just goes to the first record in the datasheet.
    Private Sub LastName_AfterU pdate()

    Me.[Units Worked Query subform].SetFocus
    DoCmd.GoToRecor d acActiveDataObj ect, , acNewRec

    End Sub
    Last edited by Dbar10; Dec 1 '08, 04:03 PM. Reason: Part 2 - More info
  • rpicilli
    New Member
    • Aug 2008
    • 77

    #2
    Originally posted by Dbar10
    In my main form I have a [LastName] field that I can scroll with my mouse to advance to any name. I have put code in this field so that On Lost Focus the cursor moves to a new record in subform [UnitsWorkedQuer y subform]. My problem is I can't click back on the LastName field and scroll because the scroll function is remaining in the subform. How can I regain control? Thanks

    Part 2: I tried moving the above command to AfterUpdate but now my code will not take me to the new record, it just goes to the first record in the datasheet.
    Private Sub LastName_AfterU pdate()

    Me.[Units Worked Query subform].SetFocus
    DoCmd.GoToRecor d acActiveDataObj ect, , acNewRec

    End Sub
    Hi there,

    For your first question, may be you're showing the form as Showdialog. In this case the focus will be there up to you close it. If this is the case try to show your subform with subForm.show(me )

    Try this and let me know.

    Rpicilli

    Comment

    • Dbar10
      New Member
      • Nov 2008
      • 17

      #3
      rpcilli,
      I amworking in an Access mdb. I can't find what you are talking about. Can you help me?

      Comment

      • rpicilli
        New Member
        • Aug 2008
        • 77

        #4
        Hi,

        Excuse me by that. This is a Forum of visual basic that's why my answer.

        May be you can try another Forum. I don't know if there is a forum of Access.

        In this matter I can not help you because I don't know anything about Access Forms.

        Good luck

        Rpicilli

        Comment

        Working...