I have a form with subform. In the After update event of my Account Number field I set the focus to the first field in the subform like so:
Private Sub Customer_ID_AfterUpdate()
Me!OrderSubform.SetFocus
End Sub
Everything works fine, but here is my problem... the entire form is just a bit longer than the screen or window will allow for all to appear without scroll bars. When it sets focus to the correct field in the subform, it scrolls down so the now focused field is at the very top of the window, making me have to re-scroll up to view the Customer info just entered. With the original view, or when scrolled all the way to the top, the field I want to set the focus to is already completely visable.
Wait a minute... as I was writing that I think i figured out why it was doing that, but still need a solution on to fix it. I'm guessing its doing it because I'm setting focus to the subform only (which itself sets focus to the first field) and not directly the field in the subform. I'm somewhat new to VBA so what would be the correct code/syntax to focus on the the field Card_Type in the subform.
BTW I am assuming that SetFocus is the same as saying "move the cursor to..." if it's not, then that's what I'm trying to do instead.
Thanks for any help here
Private Sub Customer_ID_AfterUpdate()
Me!OrderSubform.SetFocus
End Sub
Everything works fine, but here is my problem... the entire form is just a bit longer than the screen or window will allow for all to appear without scroll bars. When it sets focus to the correct field in the subform, it scrolls down so the now focused field is at the very top of the window, making me have to re-scroll up to view the Customer info just entered. With the original view, or when scrolled all the way to the top, the field I want to set the focus to is already completely visable.
Wait a minute... as I was writing that I think i figured out why it was doing that, but still need a solution on to fix it. I'm guessing its doing it because I'm setting focus to the subform only (which itself sets focus to the first field) and not directly the field in the subform. I'm somewhat new to VBA so what would be the correct code/syntax to focus on the the field Card_Type in the subform.
BTW I am assuming that SetFocus is the same as saying "move the cursor to..." if it's not, then that's what I'm trying to do instead.
Thanks for any help here