focus stuck in control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main form with 4 controls and a subform. When I try to enter a new
record and get to control 4 the focus will not leave. It should move to the
subform and has been working fine. It moves as it should on saved records.
This is only occuring in a new record. I am wondering if perhaps my db is
corrupt. I am also having a problem with a control on the subform which
after update moves the focus to the appropriate control. I had it working
correctly but now gives the error "can't move focus to State now". This
problem developed earlier and I was going to try to solve it when the main
form focus problem developed.
 
Sounds like there is an event being cancelled, and so you are not allowed
out of where you are.

If it is an event of the control (e.g. BeforeUpdate) that is being
cancelled, you will not be able to click in any other control on the form
either.

If it is an event of the form (e.g. BeforeUpdate), you will not be able to
save the record. Display the Record Selector (gray bar at left of form, the
full height of the detail section). When you are entering a new record,
press Shift+Enter. If it saves, the icon in the Record Selector changes from
a pencil to a triangle.

Hopefully you now know which event is being cancelled, and you can then
track down why the control/record is not being saved.

If none of that helps, the problem could be a corruption. Post back for more
details.
 
Thanks Allen,
There was a Cancel = ValidateTripDate() line in the form's BeforeUpdate
Event. The trip date is being validated before the update of a control so I
commented this line and it seems to be working fine. The other "can't set
focus" problem in the subform also seems to be fine now although I have no
idea what changed in relation to it.
Thanks again,
Walter


Allen Browne said:
Sounds like there is an event being cancelled, and so you are not allowed
out of where you are.

If it is an event of the control (e.g. BeforeUpdate) that is being
cancelled, you will not be able to click in any other control on the form
either.

If it is an event of the form (e.g. BeforeUpdate), you will not be able to
save the record. Display the Record Selector (gray bar at left of form, the
full height of the detail section). When you are entering a new record,
press Shift+Enter. If it saves, the icon in the Record Selector changes from
a pencil to a triangle.

Hopefully you now know which event is being cancelled, and you can then
track down why the control/record is not being saved.

If none of that helps, the problem could be a corruption. Post back for more
details.
 
Back
Top