tab control form - goto new record

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
Back
Top