ms-access


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.

Related Links

SQL query in Ms-access
Loop through for all shortcuts in a given location and return the target path
access vba execute after inserting new record
MS Access: How to Supply Parameters to a Query-Based Subform Control
Avoid duplication without using Indexed fields and 'no duplication'
how do i build a website using access 2010? [closed]
Is there a NotIn(“A”,“B”) function in VBA?
Access VBA: If Form Value <> NULL then run query else, end if. - not doing anything
ms-access: file already in use ERROR
Data from different records in one record using Access 2003
forcing EDIT of access backend database
How to collect input via a form and pass to report query in Access
sql select - order by but partial part of the field
SQL to ACCESS 2010
Select a value from a table in current DB and use a variable in Access VBA
maximum number of connections to network accessed Access database

Categories

HOME
comparison
react-virtualized
office365api
routes
react-redux
serverspec
bs4
multiple-records
numeral.js
quickbooks
etl
alignment
remote-access
jsprit
pugjs
flux
lucene.net
immutable.js
xlsxwriter
jasonette
facebook-instant-articles
pass-by-reference
telerik-reporting
microsoft-r
cas
webkitspeechrecognition
kendo-datasource
nat
bcd
grails-3.1
lxd
environment-modules
sequential
retina-display
swift3.0.2
android-browser
sqlite2
webdriver-manager
angularjs-factory
bootstrap-dialog
flashair
apple-news
logfiles
smartcontracts
dandelion
dotnetzip
aurelia-validation
carrot
sonarlint-vs
angular-cache
elements
dstu2-fhir
pcf
plottable.js
angstrom-linux
qcustomplot
bluegiga
jmeter-maven-plugin
angular-leaflet-directive
ios9.1
remobjects
lustre
geonetwork
nsmutabledictionary
gwidgets
c3
tablelayout
android-nested-fragment
file-copying
client-side-templating
flexmojos
ora-00911
delphi-6
unc
frameset
venn-diagram
dsn
tridion-worldserver
asyncfileupload
nsobject
vdsp
xmemcached
oncheckedchanged
imac
telerik-scheduler
filtered-index
nhibernate.search
rescale
exchange-server-2003
noscript
gacutil

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App