How do I tab from subform to subform?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am building a form which has 7 subforms on it. In order to simplify
navigation from one subform to the next, I would like the user to be able to
use the Tab key. Through reading previous posts, I have inserted the
following code:

Forms![Staff]![Staff Red Cross Certifications
subform].Form![RCCertification].SetFocus

The code is in the OnExit event of the last control of the preceeding
subform. The main form is "Staff", the subform and control of the preceeding
subform are "HR Cerfications subform" and "HR Certification ID",
respectively. The subform and control destination are "Staff Red Cross
Certifications subform" and "RCCertification", respectively.

Unfortunately, I received a run-time error 2465.

Please help.
 
The error says it can't find the field referred to; however, in this context,
I believe it means the control on the subform, but that still may not be the
problem. Just looking at your code, I don't see a problem. Just for
experimental purposes, try this variantion:

Me.Pareent![Staff Red Cross Certifications
subform].Form![RCCertification].SetFocus
 
is the control name plural? Certification vs Certifications

one letter wrong and it can't find the control.....
 
Klatuu,

I entered the code you suggest and now I get a run-time error 2455. I have
also checked and rechecked the names of the subforms and controls.

Any ideas?

Roy

Klatuu said:
The error says it can't find the field referred to; however, in this context,
I believe it means the control on the subform, but that still may not be the
problem. Just looking at your code, I don't see a problem. Just for
experimental purposes, try this variantion:

Me.Pareent![Staff Red Cross Certifications
subform].Form![RCCertification].SetFocus


Roy said:
I am building a form which has 7 subforms on it. In order to simplify
navigation from one subform to the next, I would like the user to be able to
use the Tab key. Through reading previous posts, I have inserted the
following code:

Forms![Staff]![Staff Red Cross Certifications
subform].Form![RCCertification].SetFocus

The code is in the OnExit event of the last control of the preceeding
subform. The main form is "Staff", the subform and control of the preceeding
subform are "HR Cerfications subform" and "HR Certification ID",
respectively. The subform and control destination are "Staff Red Cross
Certifications subform" and "RCCertification", respectively.

Unfortunately, I received a run-time error 2465.

Please help.
 
Back
Top