tabbing to subform triggers BeforeUpdate on main form?

T

Terrell Miller

I have a form with one control (call it txtID) with tab
order 0, then a subform (call it sfDetails) with tab order
1, then other controls.

What's happening is that when I am in the txtID field,
enter/change the contents, then Tab, it triggers the main
form's BeforeUpdate event. I don't want to do that,
because I haven't filled out the rest of the form yet and
there are controls where I am calling special validation
subroutines. The upshot is that I move to the subform, but
I've just saved the current record, which I don't want to
do until I get further into the main form.

All I need this to do is set focus on the subform (should
go to the control with TabStop 0) *without* triggering the
BeforeUpdate event on the main form. Then when I'm through
with the subform I have an Exit event on the lastcontrol
that jumps back up to the next control on the main form
(this parts works fine).

Is there a way to avoid the BeforeUpdate event on the main
form?

Thanks in advance!
 
A

Allen Browne

No. The focus cannot move from the main form into the subform without saving
the main form record first.

That should make sense if you think about it. The subform is designed to
store records in a table related to the main form's table. If you are at a
new record in the main form, you cannot create the related records in the
subform without saving the main form's record.
 
T

Terrell Miller

-----Original Message-----
No. The focus cannot move from the main form into the subform without saving
the main form record first.

That should make sense if you think about it. The subform is designed to
store records in a table related to the main form's table. If you are at a
new record in the main form, you cannot create the related records in the
subform without saving the main form's record.

Thanks, Allen. Never thought about it that way, but it
makes perfect sense!

Take care,
 

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