Forum Discussion
Set the Focus
I see that nobody has responded, possibly because, like me, other forum members aren't quite clear what you are asking.
1. Please clarify what type of form you are using: single/continuous/datasheet/split
2. When you refer to the first line of your forms, do you mean the first record or the first control?
3. Why do you need to set the focus to DateOfPurchase using code?
Have you tried altering the tab order so that control is the first item in the tab order?
Thank you for responding so quickly.
Single form.
What I am trying to do is get the cursor to appear on the first control of the record when the end user is finished entering data on the previous record. What the cursor is doing at present is remaining on the last control entered by the end user when a new record is begun, although on the new record.
I was given this code many years ago and it always worked. But now it is not. I am trying to figure out what is wrong. I do not write code yet. Will be learning soon.
Private Sub Form_Current()
If Me.NewRecord = True Then
Me.DateofPurchase.SetFocus
End If
End Sub