tab order - in access 2003

J

Jackson

I'm having a problem with using sub forms and setting up a tab order. So I
built a form with an continous sub form that is in the middle of the form
that has fields on top and underneath the sub form. Whenever I setup the
tab order and test out the tab order it always gets stuck in the sub form
and never tabs out of the sub form.

Does anybody know a solution this problem? Or a way around this?

TIA,

Jackson
 
J

John Vinson

Whenever I setup the
tab order and test out the tab order it always gets stuck in the sub form
and never tabs out of the sub form.

Does anybody know a solution this problem? Or a way around this?

That's expected behavior. Normally a subform is used for the "many"
table in a one to many relationship, so you would want to stay in the
subform until you've finished entering records. You can type Ctrl-Tab
to tab out of it when you're done.

If (as fairly often happens) this is a subform which will most often
have only one record, you can put a textbox last in the tab order on
the Subform. In its GotFocus event you can set the focus to the next
control in the tab order:

Private Sub txtRelay_GotFocus
Parent.SetFocus ' set focus to the parent form
Parent!controlname.SetFocus ' then to a control on that form
End Sub

It must be enabled and visible, but you can make it one pixel square
and transparent, or hide it behind another control, so the user won't
accidentally mouse click it.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
J

Jackson

Is there anyway to fix the tab order if there are multiple records in a
subform? I added the subform as a continous form because there are multiple
records associated with the main form.

Thanks again,

Jackson
 
J

John Vinson

Is there anyway to fix the tab order if there are multiple records in a
subform? I added the subform as a continous form because there are multiple
records associated with the main form.

I'm not sure what "fix" you want. When you're in the subform, entering
an arbitrary number of records, wouldn't you want the tab key to keep
you in the subform so that you can add new records, just as you would
do on any other continuous form? If you've finished entering the first
record on the subform and click the Tab key what should happen?


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
J

Jackson

wouldn't you want the tab key to keep you in the subform so that you can add
new records, just as you would do on any other continuous form?
Well yes I would like the user to be able to add a record but when they are
done adding the record I would like them to be able to tab out of the
subform. The reason I have it as continous is because there are more than
one record associated with the primary key on the main form and the user
would like to be able to see all of the records associated with the key.

If you've finished entering the first record on the subform and click the
Tab key what should happen?
I tried adding a new record in the subform and then tried tabbing through
and it just keeps tabbing through the new record instead of going out of the
subform.

Although I kind of found a work around for it. I just used a data sheet
view and it went out of the subform and went to the next tab on the main
form. I'll use a datasheet view if it's my last resort but I just prefer
the GUI part for the users also a memo field doesn't look as well formatted
in a datasheet view.

John, Thanks for all your help.

Jackson
 
J

John Vinson

wouldn't you want the tab key to keep you in the subform so that you can add
new records, just as you would do on any other continuous form?
Well yes I would like the user to be able to add a record but when they are
done adding the record I would like them to be able to tab out of the
subform. The reason I have it as continous is because there are more than
one record associated with the primary key on the main form and the user
would like to be able to see all of the records associated with the key.

I'm wondering then - if the Subform is for viewing only, and you don't
intend the user to *edit* data - if you might do just as well to set
the Tab Stop property of the subform to False, so the user won't tab
into it at all. Maybe set the Enabled property to False, and Locked to
True as well, so they can't even mouseclick into it.
If you've finished entering the first record on the subform and click the
Tab key what should happen?
I tried adding a new record in the subform and then tried tabbing through
and it just keeps tabbing through the new record instead of going out of the
subform.

Sounds like the Form you're using has its Cycle property set to "Same
Record". Did you try my relay textbox idea?


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
D

Dirk Goldgar

Jackson said:
wouldn't you want the tab key to keep you in the subform so that you
can add new records, just as you would do on any other continuous
form?
Well yes I would like the user to be able to add a record but when
they are done adding the record I would like them to be able to tab
out of the subform. The reason I have it as continous is because
there are more than one record associated with the primary key on the
main form and the user would like to be able to see all of the
records associated with the key.

If you've finished entering the first record on the subform and click
the Tab key what should happen?
I tried adding a new record in the subform and then tried tabbing
through and it just keeps tabbing through the new record instead of
going out of the subform.

Although I kind of found a work around for it. I just used a data
sheet view and it went out of the subform and went to the next tab on
the main form. I'll use a datasheet view if it's my last resort but
I just prefer the GUI part for the users also a memo field doesn't
look as well formatted in a datasheet view.

One thing youi can do is have the code in the relay text box check to
see if you're on the new record and the record is not dirty, and only
send the focus out of the subform if both conditions are true.
 
Top