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

How to lock vertical scrollbar in MS Access
Need Help regarding this IIF statement
How to enable 1 user to update the database while allowing others to only read in Microsoft Access?
Operation is not allowed when the object is open
Single prompt parameter for shared parameter in sub-reports' queries
Don't show corresponding field items
VBA traversing through recordset via button
Add new Items in a combo box in access
Generate an ID from different column choices in Microsoft Access 2013
MSACCESS query: not part of an aggregate function
pdi spoon ms-access concat
iff command issue in MS Access
How to display the maximum value from one column in a listbox, in a textbox on the same form
access 2010 writing SQL statements
Add Working Days to Start Date to Create End Date (including Bank Holiday)
ms access input mask MM/DD/YYYY

Categories

HOME
compiler-construction
clips
testng
asp.net-core
deployment
netsuite
omnet++
magnific-popup
office365api
objectgears
webpack-2
kibana-4
etl
windows-azure-storage
try-catch
openrefine
transformation
ef-migrations
nhibernate-envers
contextmenu
alpine
immutable.js
jquery-ajaxq
orleans
zurb-foundation-6
pepper
phpfox
ejabberd-module
dbclient
librato
nat
bluestacks
stormpath
javascriptcore
phonegap
oracle-fusion-middleware
webtest
stringtemplate
accelerate-framework
hexo
catalog
overriding
automake
starteam
az-application-insights
hue
dism
android-tabhost
eclipse-scout
quadratic-programming
firebase-admin
http-redirect
outlook-2013
jquery-nestable
sage-one
domain-model
togetherjs
sqlbulkcopy
memory-alignment
hittest
chord-diagram
eventkit
parallel-data-warehouse
spring-android
gstreamer-0.10
contact-list
connect-by
flash-cs5
lua-5.1
ipconfig
design-by-contract
xpath-1.0
lib.web.mvc
collapse
intellij-14
jmeter-maven-plugin
wyam
android-listview
method-parameters
operation
apache-commons-fileupload
c++03
javax.mail
npapi
sorl-thumbnail
typekit
issuu
project-planning
has-many-through
p4java
java.nio.file
access-rights
mhtml
trusted
rdoc
propertyeditor
twrequest
buildr
joyent
xdomainrequest
winbugs14
floating
thunderbird-lightning
firefox-5
meego
swing-app-framework
noscript
msdev
3gp

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