Stubborn Subform (1 Viewer)

Beerbrewer

Registered User.
Local time
Today, 19:41
Joined
Jul 18, 2002
Messages
22
On a main form are three leveled subforms:
- Form_Customer
- Form_Mailing
- Form_Subject
- Form_Invoice
When a control on a subform has got the focus once, the normal taborder is somehow overruled. When I use the TAB-key to leave the main form and enter Form-Mailing, the cursor jumps to the control on the subform which was the latest activated.
It is possible to move the focus with a macro or vba to the main form, but impossible to move from there to a control on a subform (other than the one in which the control is placed that was activated the latest). I get an error message that the control cannot be found in the current record.
How can this stubborn focussing be undone?
 

Howlsta

Vampire Slayer
Local time
Today, 19:41
Joined
Jul 18, 2001
Messages
180
This should do the trick....

put the following code in the lost focus event of the last control on your main form.

Forms!yourmainform!yoursubform!yourcontrolonsubform!setfocus

I'm presuming that you want the first control on the subform to get focus everytime you tab into the subform.

best of luck

Rich
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:41
Joined
Feb 19, 2002
Messages
43,392
You might have better luck putting the setfocus command in the onCurrent event of EACH subform.

Me.Whateverthefirstfieldonthissubform.SetFocus
 

Users who are viewing this thread

Top Bottom