how to place the cursor in the field of a subform

D

Douglas J. Steele

Okay, that makes sense. Sorry about that (I didn't bother testing).

Change the BeforeUpdate to

Private Sub PayDate_BeforeUpdate(Cancel As Integer)

If IsDate(Nz(Me.PayDate, "X") = False Then
Cancel = True
End If

End Sub

Change focus in the AfterUpdate event:

Private Sub PayDate_AfterUpdate()

Me!NameOfSubformControl.SetFocus
Me!NameOfSubformControl.Form!NameOfControlOnSubform.SetFocus

End Sub
 

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