tab control form - goto new record

G

Guest

I have a Main form with 6 tab sub forms. I need the sub forms to load to
a new record. The following code does not work.


Private Sub TabControl_Change()
Dim CurConn As ADODB.Connection
Dim CommitNumber As New ADODB.Recordset

Set CurConn = CurrentProject.Connection

On Error GoTo ErrorHandler
With Me
Select Case .TabControl.Value
Case 0 'Clients


Case 1 'Pair_Outs

DoCmd.GoToRecord , "", acNewRec

Any help would be appreciated.
 
G

Guest

If you want the sub form to move to a new record, then you need to set the
focus to the sub form first, before moving to a new record

Me.[SubFormControlName].SetFocus
DoCmd.GoToRecord , "", acNewRec
 

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