Bryant
Bryant

Reputation: 714

Microsoft Access Form Save Record

I am designing an MS Access 2013 database, and I routinely need to populate a table with three fields. The values to populate it are predictable for the most part, so I have created a form with three text boxes that each have a calculated default value specified. The form is marked for data entry, so a new record is created by default.

Opening the form populates each text area. When all of the default values are acceptable for the new record, I would like to simply be able to click save or to press ctrl + s. However, all save attempts do nothing unless one of the values in one of the text areas has been modified first.

How do I fix this behavior so that nothing in any of the text areas must be manually modified in order to save the record?

Upvotes: 0

Views: 1255

Answers (1)

Gustav
Gustav

Reputation: 55921

Move focus to a field that is editable and bound to the table:

Me!SomeField.SetFocus

Then call these two commands:

Me.Dirty = True
Me.Dirty = False

Upvotes: 1

Related Questions