G
Gator
Why won't the following code place the cursor in the field "FundNumber" in
the subform?
Private Sub Command10_Click()
On Error GoTo Err_Command10_Click
If IsNull(Me.PayDate) Then
Me!PayDate.SetFocus
Else
Me.TabCtl27.Pages(0).SetFocus
Me.PayablesDetailssubform1.SetFocus
DoCmd.GoToRecord , , acFirst
Me!PayablesDetailssubform1.Form.Controls(FundNumber).SetFocus
If IsNull(Me.PayablesDetailssubform1) Then
Me.TabCtl27.Pages(0).SetFocus
Me.PayablesDetailssubform1.SetFocus
DoCmd.GoToRecord , , acFirst
Me!PayablesDetailssubform1.Form.Controls(FundNumber).SetFocus
Else
Me!PayDate.SetFocus
DoCmd.GoToRecord , , acNewRec
Me!PayDate.SetFocus
End If
End If
Exit_Command10_Click:
Exit Sub
Err_Command10_Click:
MsgBox Err.Description
Resume Exit_Command10_Click
End Sub
the subform?
Private Sub Command10_Click()
On Error GoTo Err_Command10_Click
If IsNull(Me.PayDate) Then
Me!PayDate.SetFocus
Else
Me.TabCtl27.Pages(0).SetFocus
Me.PayablesDetailssubform1.SetFocus
DoCmd.GoToRecord , , acFirst
Me!PayablesDetailssubform1.Form.Controls(FundNumber).SetFocus
If IsNull(Me.PayablesDetailssubform1) Then
Me.TabCtl27.Pages(0).SetFocus
Me.PayablesDetailssubform1.SetFocus
DoCmd.GoToRecord , , acFirst
Me!PayablesDetailssubform1.Form.Controls(FundNumber).SetFocus
Else
Me!PayDate.SetFocus
DoCmd.GoToRecord , , acNewRec
Me!PayDate.SetFocus
End If
End If
Exit_Command10_Click:
Exit Sub
Err_Command10_Click:
MsgBox Err.Description
Resume Exit_Command10_Click
End Sub