Moving from SubForm to MainForm causing the SubForm record to goto add new

  • Thread starter Thread starter CES
  • Start date Start date
C

CES

All,
The Record navigation isn’t working the way I would like when I SetFocus away from the SubForm.

On my Main Form (FormContacts) I have a SubForm (FormAddress) after I add data to the last field in the SubForm (FormAddress) I want to set focus on the main form (FormContact) I’ve been able to do this with a LostFocus() Event using the following code… both of these seem to work:

'Me.Parent.Controls("cPhoneWork").SetFocus

'Me.Parent.SetFocus
'Me.Parent! cPhoneWork.SetFocus

The problem is when I move to the cPhoneWork control on the main form, from the SubForm control, the SubForm moves to a new record. I’ve been able to figure out the problem is that the control on the SubForm is the last tab stop… Any suggestions on how I might change this behavior. Thanks in advance. - CES
 
Hi CES,

Easy one to fix... in your subform, you need to change the property on the
"Other" tab from "Cycle All Records" to "Cycle Current Record". This will
stop your subform from jumping to a new record as you tab out of the last
control.

You should just be able to then use the setfocus event to set the focus back
to the necessary spot on the parent form.

Hope this helps.

Damian.
 
Back
Top