default values in record causing auto number to change

jojo

Registered User.
Local time
Today, 02:12
Joined
Jul 20, 2012
Messages
51
In Access 2010, i have a form that calls a form for data entry and it opens to a new record for data entery. I have put some default dates and a combo box value into the properties on the form. When the form opens, it already has an autonumber, so if the user closes without adding any fields, a record is saved. If I take out those defaults, then when the form is opened, the autonumber shows (new), which is what I want it to do. If i put the default dates in the table, the autonumber is (new). When I add a default of text in a combo box, the form opens with an autonumber. Did anyone have this strange situation, and figured out what to do? thanks!
Jojo
 
Are you setting the .DefaultValue property of the controls in question, or are you setting their values?
 
I am setting the properties at design time on form's property sheet, then i changed it to table design
thanks for any help
jojo
 
Exactly what property are you setting and to what value?
 
You can solve the issue by:
1. Set form properties Close button = false so user can't close the form via the control box.
2. Add a Save and Cancel button to the bottom of the form.

Add some code behinde the Save button OnClick event:
docmd.RunCommand accmdsaverecord
docmd.Close

in the Cancel Button click add this code:
SendKeys ("{ESC}{ESC}")
DoCmd.Close
 

Users who are viewing this thread

Back
Top Bottom