How to force access to begin a new record
I have a form with a few bound fields and a few 'custom made' checkboxes, which set values per vba. When I now start a new record with 'DoCmd.GoToRecord , , acNewRec', Access clears my form but won't create a fresh ID until a value is entered into one of the bound fields. Since my checkbox-fields are not bound, any changes before a bound field has been edited won't be saved. I tried adding values via sql statements, but access throws an error after I change another field stating that the current recordset has been changed so I doubt that this is the way to go. My form is based on a query and witch vba I set the checkboxes like [value_x] = true (which works fine when I first enter data into a bound field and thereby a new record is created). (Another way to avoid this would be to set any bound field during the onload-event to a value and remove the value afterwards. But that's not very clean I guess ..)
After testing a few approaches I found my earlier stated idea to be the easiest approach. This means I set a value of a bound field in the form_load event and work with me.dirty where neccessary. Of course I have to delete empty recordsets afterwards (if someone only opens and closes the form), but that can be handled very easy. Another great idea was the one Robert Harvey gave me. He suggested to add a click event to my unbound custom checkboxes and use this to change a hidden bound checkbox field, which also worked great.
MS Access 2003 - Auto assigning an Identification Number
Ms access: Autocomplete field with values from another table
MS-Access: hotkey to display a message box
.mdb - Access - database appending # on image file
MS-Access 2007 - 255 character limit for exports and field concatenation
Avoiding MaxLocksPerFile via odbc connection to MS Access
Access MDB: do access MDB files have an upper size limit?
Problem evaluating NULL in an IIF statement (Access)
WM_SETFOCUS Event not fired Microsoft Access 2000
Access VBA sub with form as parameter doesn't alter the form
Where can I find MSAccess Control in Database
MS Access 2003 - Really simple query
Query to add missing rows using values from prior period
How can I know which item in a mult-select Microsoft Access listbox was clicked?
Is it possible to save year 1 to 99 as date-value in Access database?
How to bottom-align string in Access report textbox?