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

Cursor moving on multi Subforms in a form

P: 30
Issue with Cursor moving on multi Subforms in a form

I have two Subforms in a main form as per screenshot. So Cursor moving from Main form to 1st Subform working is good. After canít move the cursor from 1st subform to 2nd subform with tabbing or entering and still there in 1st Subform in the last entered filed. Iíve checked on tab orders they are shown correct and checked the subform Property Cycle & tried also (All Records, Current Record & Current Page) but there is no change move to 2nd subrom. Can you please replay how to solve this problem? Is there any VBA code requires?

Thanks,
Sandhya.
Attached Images
File Type: jpg Cursor Moving in multi subforms.jpg (69.7 KB, 383 views)
Mar 6 '15 #1
Share this Question
Share on Google+
7 Replies


twinnyfo
Expert Mod 2.5K+
P: 3,482
I assume your Main form has controls in correct tab order with the First SubForm before the second SubForm?

Thus, when you enter a SubForm, it does not matter what the Tab order is on the Main form, as you are no longer on that Form. You cannot (as far as I know) navigate using the tab key from one subform to the next subform (nor back to the main form. You can only begin on the main form and navigate tot eh subform.

Perhaps you could add a procedure in the first subform, in the AfterUpdate Event of the last control you are in sets the focus onto the SubForm (or even a specific control on the second SubForm.

This would be about the only way I know around this issue. However, it would require you to update that last control. As long this is the case it would work.

Hope this hepps.
Mar 6 '15 #2

Brilstern
100+
P: 208
Just thinking out loud here.

You could make a what I like to call invisible control, it is just a txt box that is set to ="." and made super small, and set it to the last tab order. Set the On Focus event to change your focus to your 2nd Subform.

Could this work TF?

It may be crude but efficient nonetheless.
Mar 6 '15 #3

twinnyfo
Expert Mod 2.5K+
P: 3,482
Stevan,

It certainly would work. It is the same concept I described. There will be problems with either, as what happens if a user needs to update several of the "key" text boxes or "tabs" through a series of records on the first subform.

There are advantages and challenges to each recommended solution. There may also be some unexpected results for the user who doesn't understand what is going on....
Mar 6 '15 #4

Brilstern
100+
P: 208
Very true! Tab controls can be so tricky when considering the user of the database.
Mar 6 '15 #5

P: 30
Thanks for replay twinnyfo & Stevan,

Yes, Just I was checked again the main form tab order it’s shown correct. And I need to begin on the main form to Subform1 & 2 and finally come to main form. Once Attached the Main & Subform’s Tab Order screenshots… if any wrong in Tab order.

I’ve tried following VBA code in the first subform, in the AfterUpdate Event of the last control. But there is no workout. Can you please replay how to give a VBA code?

Expand|Select|Wrap|Line Numbers
  1. Private Sub Amount_AfterUpdate()
  2. Form![SB_1]![SB_1Subform_Rec].SetFocus
  3. End Sub
  4.  
  5. Form Names:
  6. Main form: PB_1
  7. Subform 1: PB_1Subform
  8. Subform 2: PB_1Subform_Rec
  9.  
And a little bit confusion about set to ="." how to use this :(

Thanks,
Sandhya.
Attached Images
File Type: jpg Tab Orders Screenshot.jpg (39.3 KB, 154 views)
Mar 6 '15 #6

twinnyfo
Expert Mod 2.5K+
P: 3,482
Try this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Amount_AfterUpdate()
  2.     Me.Parent.Form.PB_1Subform_Rec.Form.ControlName.SetFocus
  3. End Sub
Also, please use code tags around your code.
Mar 6 '15 #7

P: 30
Thanks for suggestion... i will try this
Mar 7 '15 #8

Post your reply

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