I have a small form that on load I want to go to a new record and set some fields to certain values.
This code works fine:
Code:
Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec
End Sub
but as soon as I modify it so:
Code:
Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec
Applied = False
End Sub
Instead of making a new record and setting the value of [Applied] to False, it will go to some record in the middle, and set the value to false, apparently. If I try to save, it says that the changes were not successful because they would set duplicate values (Which is true since I have 50+ records and the primary key it is showing is 25 or so, so obviously the same as one existing)
Also, if I let this second code run, and then hit escape, it will then jump to a new record.
How should I fix this?