strange focus/control prob on subform 
Author Message
 strange focus/control prob on subform

I have a form and subform that are used for shop data collection. There are
many, many subs on the subform that guide focus through a logistical maze
depending upon the inputs. In all but one case, the focus moves exactly
where it should. In all cases the focus moves to a control on the parent
form, then back to a control on the subform that resides in the last record
of a particular worker.

The problem comes in when an "end of day" series of subs is used to stop
recording of that person's production. The focus is passed to the parent
form, where another worker puts in their user ID and the focus is passed
back to the subform, as it should. However, instead of the focus going to
the control in the last record it goes to the same control in a different
record. If I use the Enter key or the arrow key the focus moves immediately
to the proper control and record. This only happens after the End of Day
scenario.

I've tried the docmd.gotocontrol, docmd.gotorecord ,  , acLast, setfocus,
refresh commands. Nothing seems to work. It's almost like the
docmd.gotoRecord command is getting skipped over but the gotoControl command
is working. All I need it to do is go to the last record when a new employee
pulls their work record to input more data.

Any help is greatly appreciated!

Todd Sinclair



Sun, 24 Apr 2005 03:44:54 GMT  
 strange focus/control prob on subform
That's really too complicated to understand, Todd.

I guess you are asking "is there a known bug in Access?" I don't even know
which version of Access you refer to.

Since you are referring to getting the wrong record, be aware that there is a
setting "Cycle" in the "Other" properties of a form.

As this might not be available in previous Access, I simulated the same by
having an invisible object to trap the focus to prevent inadvertent wandering
to the next record. At the end of the key sequence.

Since it works in all but one case, and we don't have your app, it's up to you
to determine what is different about that one case, I'm afraid. Like, is it
the last one?


Quote:
> I have a form and subform that are used for shop data collection. There are
> many, many subs on the subform that guide focus through a logistical maze
> depending upon the inputs. In all but one case, the focus moves exactly
> where it should. In all cases the focus moves to a control on the parent
> form, then back to a control on the subform that resides in the last record
> of a particular worker.

> The problem comes in when an "end of day" series of subs is used to stop
> recording of that person's production. The focus is passed to the parent
> form, where another worker puts in their user ID and the focus is passed
> back to the subform, as it should. However, instead of the focus going to
> the control in the last record it goes to the same control in a different
> record. If I use the Enter key or the arrow key the focus moves immediately
> to the proper control and record. This only happens after the End of Day
> scenario.

> I've tried the docmd.gotocontrol, docmd.gotorecord ,  , acLast, setfocus,
> refresh commands. Nothing seems to work. It's almost like the
> docmd.gotoRecord command is getting skipped over but the gotoControl command
> is working. All I need it to do is go to the last record when a new employee
> pulls their work record to input more data.

> Any help is greatly appreciated!

> Todd Sinclair




Sun, 24 Apr 2005 05:22:44 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Form/SubForm/Control focus problems

2. strange behavior of control.focus() funktion. Need Help

3. Control name of subform from code behind subform

4. A Bit of a strange prob

5. VERY STRANGE PROB. WITH MEMORY

6. Strange DSN prob...

7. Strange Subform Record Behavior

8. strange behaviour of a subform, or a bug?

9. Any ways to make focus on Label control like focus in button control

10. lost focus prob

11. Need help with MDI Focus/Arrow key prob

12. Prob: IE + onBlur="window.focus()"

 

 
Powered by phpBB® Forum Software