By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,434 Members | 2,884 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,434 IT Pros & Developers. It's quick & easy.

Setting focus to single form portion of split form

P: 122
Hey all, another question about split forms in Access 2007. Hopefully this one is a quick one.

I have a bound spit form for data entry. The split form portion does not allow edits. I want it to be so that if the user clicks on the new record line of the split form (or arrows down to it, what have you) the focus moves automatically to the first data entry field (on the main form). What is happening though is that focus is moving to that field on the split form, which doesn't help since they can't type into it.

Here is the code that I have:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.   If Form.NewRecord Then
  3.     Forms![frmDataEntry].[txtItem].SetFocus
  4.   End If
  5. End Sub
Does anyone know how can I specify that I want the text control on the top (single form) part to have the focus?
Mar 10 '10 #1
Share this Question
Share on Google+
1 Reply

P: 5
F6 will toggle the focus between the detail and datasheet section. I have been unable to find any syntax for moving the focus in VBA and resort instead to SendKeys "{F6}{F6}". You can determine whether the focus is in the datasheet by setting a Module Variable, it will not be available when the focus is in the datasheet.
Sep 17 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.