Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Shifting focus to a subform (2000)

    Hi,

    I am working with a form that has a subform on it called sfrmTimeSheet. There is a list box control that the user clicks to activate the appropriate employee name in the subform. After clicking I would like the subform to receive the focus as well as to be on a new record. I'm not sure how to code for this.

    Thanks,
    Leesha

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Shifting focus to a subform (2000)

    How do I reconcile "activate the appropriate employee name in the subform" and "the subform to receive the focus as well as to be on a new record". I'm probably dense...

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Shifting focus to a subform (2000)

    Na, you're not dense Han's, as always its the my wording!! I was just about to post back that after hours of trying I finally got it (I think). I used docmd.gotocontrol.subformtimeSheet - that set the focus to the subform. I'm tickled. Now my question is what is the best event to put the code to go to a new record?

    Leesha

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Shifting focus to a subform (2000)

    Instead of DoCmd.GoToControl subformTimeSheet you can also use subformTimeSheet.SetFocus. Both will work. After that, use DoCmd.GoToRecord , , acNewRec to go to a new record.

    Best event? <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  5. #5
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Shifting focus to a subform (2000)

    Thanks Hans!!

    Leesha

Posting Permissions

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