Forms and sub forms

M

Mike

Hi guys
Heres the problem:-
I have a subform within a form. When the user enters data into the last
cell of the subform I have set an Event proceedure on the Lost Focus, to
send the focus back to the parent form. The problem is that the subform
still advances to show a blank record. How do I send the focus back to the
parent form and keep the subform from moving to the 'next' record?

Thanks in advance.

Mike
 
A

Arvin Meyer [MVP]

Mike said:
Hi guys
Heres the problem:-
I have a subform within a form. When the user enters data into the last
cell of the subform I have set an Event proceedure on the Lost Focus, to
send the focus back to the parent form. The problem is that the subform
still advances to show a blank record. How do I send the focus back to
the parent form and keep the subform from moving to the 'next' record?

This should work:

Private Sub SubformControl_LostFocus()
Me.Parent.[Main Form Control].SetFocus
End Sub

I think it also depends upon the cycle property of the records on the 2
forms. Try experimenting a bit to determine the behavior you want to
achieve.
 
M

Mike

Arvin Meyer said:
Mike said:
Hi guys
Heres the problem:-
I have a subform within a form. When the user enters data into the last
cell of the subform I have set an Event proceedure on the Lost Focus, to
send the focus back to the parent form. The problem is that the subform
still advances to show a blank record. How do I send the focus back to
the parent form and keep the subform from moving to the 'next' record?

This should work:

Private Sub SubformControl_LostFocus()
Me.Parent.[Main Form Control].SetFocus
End Sub

I think it also depends upon the cycle property of the records on the 2
forms. Try experimenting a bit to determine the behavior you want to
achieve.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
Thanks Arvin
I have that set already and it does not seem to wotk. Although focus is
transfered to the correct control on the parent form, the subform still
advances to an empty record. I need the subform to stay on the record that
has just been updated.

Regards

Mike
 

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