2 questions about a subform

G

Guest

Gday

Couple of questions I can't figure out, I'd really appreciate your help

1. Have a subform with multiple records (continuous view) on a main form. 4 controls on the main form, the subform has the 2nd tab order
When I get to the last record in the subform and press tab, I'd like it to get out of the subform and continue with the tab order of the main form. How can I do this? Currently the statusbar says 'calculating...' for a couple of seconds and it doesn't move

2. Within the subform, on each record there is a combobox. On Focus it requeries the combobox to make the options valid for the record that it is on. Each record only has 1 enabled control which is this combobox. Some records have a default value in the combox saying "No response for this record". What I want to do is that if somebody tabs into this record I want to include code (on focus with the current requery code) that will say

If combobox = "No response for this record" then <tab to next record/control

What code do I use for this

Thanks loads

Mikey
 
D

Dirk Gently

2. I'm not sure why you would want to use the On Focus event in this
situation because I'd think that you would want the combobox filled
correctly even if the control does not have the focus. You could add code to
the On Current event for the subform and after initializing your combobox
the way you want it, then run the SetFocus method for the control you want
to jump to.

Bill Nicholson
Access Dufus


Mikey said:
Gday!

Couple of questions I can't figure out, I'd really appreciate your help:

1. Have a subform with multiple records (continuous view) on a main form.
4 controls on the main form, the subform has the 2nd tab order.
When I get to the last record in the subform and press tab, I'd like it to
get out of the subform and continue with the tab order of the main form.
How can I do this? Currently the statusbar says 'calculating...' for a
couple of seconds and it doesn't move.
2. Within the subform, on each record there is a combobox. On Focus it
requeries the combobox to make the options valid for the record that it is
on. Each record only has 1 enabled control which is this combobox. Some
records have a default value in the combox saying "No response for this
record". What I want to do is that if somebody tabs into this record I want
to include code (on focus with the current requery code) that will say:
 
G

Guest

Hi

Can anyone offer a solution to question 1? This is an important part of my form (how to make it so that when you tab from the last record on a subform it will jump to the next tab control in the main form?)

Dirk, thanks - the idea to include a move next operator on current event seems good - bear in mind there is only one control though (it is a continuous form), and what I would need to do is move to the same control on the next record

I guess I would need to have code to say something like
If cbo = "No response for this question" the
move to next recor
cbo.setfocu
end i

Would you agree? Any ideas on question 1 as well

Thanks

Mike

----- Dirk Gently wrote: ----

2. I'm not sure why you would want to use the On Focus event in thi
situation because I'd think that you would want the combobox fille
correctly even if the control does not have the focus. You could add code t
the On Current event for the subform and after initializing your combobo
the way you want it, then run the SetFocus method for the control you wan
to jump to

Bill Nicholso
Access Dufu


Mikey said:
4 controls on the main form, the subform has the 2nd tab order
When I get to the last record in the subform and press tab, I'd like it t
get out of the subform and continue with the tab order of the main form
How can I do this? Currently the statusbar says 'calculating...' for
couple of seconds and it doesn't moverequeries the combobox to make the options valid for the record that it i
on. Each record only has 1 enabled control which is this combobox. Som
records have a default value in the combox saying "No response for thi
record". What I want to do is that if somebody tabs into this record I wan
to include code (on focus with the current requery code) that will say
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top