Go to a new record on a subform

P

pokdbz

I have a main form with a button on it to save.

On the subform I have a call log that has multiple call logs.

I would like to hit the save button on the main form and then make the
subform go to a new record.

How can I do this?
 
P

Pat Hartman

Moving focus from the subform to the main form will in and of itself, save
the subform record so the save button on the main form is redundant.

Tabbing out of a new record in the subform from should automatically bring
you to a new empty record.
 
L

Lidia

Pat Hartman said:
Moving focus from the subform to the main form will in and of itself, save
the subform record so the save button on the main form is redundant.

Tabbing out of a new record in the subform from should automatically bring
you to a new empty record.
 
S

strive4peace

hi Lidia,

'~~~~~~~~~~~~~~~~~~~
With Me.subform_controlname
If Not .Form.NewRecord Then
.Form.Recordset.AddNew
End If
'if you want to set the focus
.SetFocus
.Form.ControlName.SetFocus
End With
'~~~~~~~~~~~~~~~~~~

WHERE
subform_controlname is the Name property of the subform control
ControlName is the Name property of a control on the subform

Warm Regards,
Crystal

*
:) have an awesome day :)
*
 

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