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

Powerpivot + Access + SSAS Cube
How to make the input dates which user type in the prompt show in report ? MS Access 2013
Access 2016 create table with field properties for combobox
MS Access Date Grouping is not working in report
Access query to find who didn't test over a range of dates
Error 6 Overflow using Access 2.0 and Access Basic
Runntime error 2115
Is there a way to protect a field so that only certain users can edit?
Format Text Field To Date In Access Query
Changing date format in access table
Sum daily totals plus grand total from multiple tables in MSSQL
Access ComboBox to TextBox
Pulling text from another text field in MS-access
Null indexed values in Access ComboBox
Access DoCmd.TransferText Specification Argument Location
Access how to see the database mapping

Categories

HOME
deployment
netbeans
reflection
activiti
homebrew
appx
android-4.4-kitkat
bookshelf.js
frameworks
blueprintjs
onelogin
kibana-4
export-to-csv
circular-dependency
windows-phone-7
size
static-libraries
ups
telephony
windows-7-x64
excel-vba-mac
nhibernate-envers
viewport
alpine
emulator
plunker
conemu
reverse-proxy
cx-freeze
intentfilter
arabic
css-animations
pass-by-reference
chromebook
bootstrap-duallistbox
fgetcsv
maquette
skia
sql-server-2012-express
tinymce-4
react-chartjs
file-format
main
restlet
multilingual
android-browser
abstract-class
android-fingerprint-api
android-tabhost
gulp-sourcemaps
eigenvalue
skeleton-css-boilerplate
angular-resource
jsch
multipeer-connectivity
rails-routing
logparser
sage-one
tropo
pdfclown
flow-control
sonarlint-vs
google-cdn
word-vba-mac
nxt
elements
multi-level
sigabrt
hover-over
packagist
fadeout
srand
sdhc
tmuxinator
tarjans-algorithm
muse
emailrelay
android-listview
ideamart
splash
unity5.2.3
proj4js
oxwall
camanjs
qpainter
gadt
asp.net-dynamic-data
javafx-webengine
websocket4net
dml
stxxl
terminal-services
access-rights
dir
orchardcms-1.7
jquery-knob
rdoc
gdata-api
frameset
datawindow
multipage
viewswitcher
work-stealing
mercurial-server
zpt
mod-auth
locationlistener
rfc1123
winbugs14
disclosure
actionview
floating
yslow
google-friend-connect
gamequery
sproutcore-2
backcolor
sector

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