Forum Discussion
faxylady
Jul 07, 2021Copper Contributor
Set the Focus
06/08/21 Many years ago, I acquired some code to allow me to have the cursor start on my first line of my forms. Even though I have changed the lines to correspond with each form, for some reason, I...
isladogs
Jul 07, 2021MVP
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?
isladogs
Jul 07, 2021MVP
Forgot to say...
The NewRecord property is for the form...not a specific control.
Something like this should work
Sub NewRecordMark(frm As Form)
If frm.NewRecord = True Then MsgBox "You're in a new record."
End Sub
- faxyladyJul 08, 2021Copper ContributorYour code did not work when I hit the Next Record Button or the Add New Record Button. The cursor should appear on the very first line, "DateofPurchase."