New record created to table if nothing done??

T. McConnell

Registered User.
Local time
Today, 15:29
Joined
Jun 21, 2019
Messages
63
So basically I am running into an issue where I have a form to track expenses. When the form loads, instead of having New in my Expense ID field as being a new record, it loads up to the new Auto Number already generated. Issue I have is when the form loads, it creates the record in the table, but no information may be entered at that time. If this happens over and over from the user, then it could end up having a huge amount of empty records in my Expense table.
Is there something I am missing that could be causing the form to auto generate the Expense ID on loading instead of showing New and not saving the record to the table on loading?

I have tried using the following code on the On Open as well as the On Load Event.
Code:
DoCmd.GoToRecord , , acNewRec
 
Thanks Pat,
I found I had some code in my OnLoad that was actually causing it ugh lol.
 
Thanks Pat,
I found I had some code in my OnLoad that was actually causing it ugh lol.
If you want to make sure a certain value is entered for new records, you could consider using the Default Value property instead of just assigning the value right away.
 

Users who are viewing this thread

Back
Top Bottom