Here is my situation:
I have a form with a subform (subform1 - a single form) with a subform embedded in it (subform2). Subform2 is a continuous form that contains informational data only that cannot be edited. Subforms2 can have an infinite number of records (but mostly likely 2) and you can't edit, add or delete anything on subform 2.
When I'm on my last field of subform1 and I tab I go to subform2. I would rather go to the next record of subform1.
I can't seem to bypass going to subform2. I have added code to the GotFocus event of subform2 to send focus back to the first field of subform1. But then I'm still on the same record of subform1 and I want to move to the next record. I've tried setting a flag so if I've come back from subform2, subform1 recognizes this. I try to use:
docmd.gotorecord,, acnext
in the enter event of the first field of subform1 but then I get an error message from the subform2 gotfocus event that says I can't move the focus to that first field of subform1. (once I take the gotorecord code out setting the focus to the first field of subform1 works just fine.)
Also when I use:
docmd.GoToRecord acDataForm,"subform1",acNext
from within subform1 I get a message that says the object "subform1" isn't open when I'm executing code in the object.
I am very frustrated. Anyone know how I can either
1) skip going to subform2 or
2) get back to subform1 and on to the next record?
Your help would be greatly appreciated.
- MAS
I have a form with a subform (subform1 - a single form) with a subform embedded in it (subform2). Subform2 is a continuous form that contains informational data only that cannot be edited. Subforms2 can have an infinite number of records (but mostly likely 2) and you can't edit, add or delete anything on subform 2.
When I'm on my last field of subform1 and I tab I go to subform2. I would rather go to the next record of subform1.
I can't seem to bypass going to subform2. I have added code to the GotFocus event of subform2 to send focus back to the first field of subform1. But then I'm still on the same record of subform1 and I want to move to the next record. I've tried setting a flag so if I've come back from subform2, subform1 recognizes this. I try to use:
docmd.gotorecord,, acnext
in the enter event of the first field of subform1 but then I get an error message from the subform2 gotfocus event that says I can't move the focus to that first field of subform1. (once I take the gotorecord code out setting the focus to the first field of subform1 works just fine.)
Also when I use:
docmd.GoToRecord acDataForm,"subform1",acNext
from within subform1 I get a message that says the object "subform1" isn't open when I'm executing code in the object.
I am very frustrated. Anyone know how I can either
1) skip going to subform2 or
2) get back to subform1 and on to the next record?
Your help would be greatly appreciated.
- MAS