Automatic Updates

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hello All,

Is there way in VBA to suppress the automatic updating of
records. I don't need to have it prompt me to save. I
just want some way of turning this function on or off as I
need.

Thanks in advance.

Chris
 
Hello All,

Is there way in VBA to suppress the automatic updating of
records. I don't need to have it prompt me to save. I
just want some way of turning this function on or off as I
need.

Thanks in advance.

Chris

If you wanted to toggle that then you might have a checkbox called
chkWarn. If you want the warnings then check it.

In the form's BeforeUpdate event...

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.chkWarn Then
If MsgBox("Save changes?", vbYesNo) = vbNo Then
Cancel = True
End If
End If
End Sub


- Jim
 
docmd.setwarnings false

Don't forget to turn this option back on at the end of
your code or you run the risk of not being able to decide
if you want to save changes or not.

docmd.setwarnings true
 
docmd.setwarnings false
docmd.setwarnings true

This turns auto messaging on and off. Make sure you turn
it back on at the end of your routine.

OS
 
Hi there:

What I like to use are the following in most of my database project startup
modules-

ChangeProperty "confirmrecordchanges", dbBoolean, False
ChangeProperty "confirmdocumentdeletions", dbBoolean, False
ChangeProperty "confirmactionqueries", dbBoolean, False

This pretty much cancels all of the pesky popups! In fact, here are my setup
properties- be careful when you use them- if you change the 'ChangeProperty
to ChangeProperty (i.e. remove the single quote) on certain lines, you could
make your database permanently CLOSED to further programming:

Sub SetStartupProperties()
'If DATE > #12/1/205# Then
'Application.Quit acQuitSaveAll ' set limits for the lifespan of your
project
'End If
'ChangeProperty "StartupShowDBWindow", dbBoolean, False
'ChangeProperty "StartupShowStatusBar", dbBoolean, False
'ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
'ChangeProperty "AllowFullMenus", dbBoolean, True
'ChangeProperty "AllowBreakIntoCode", dbBoolean, False
'ChangeProperty "AllowSpecialKeys", dbBoolean, True
'ChangeProperty "AllowBypassKey", dbBoolean, False
ChangeProperty "confirmrecordchanges", dbBoolean, False
ChangeProperty "confirmdocumentdeletions", dbBoolean, False
ChangeProperty "confirmactionqueries", dbBoolean, False
Call MultiAccess.winCheckMultipleInstances(False)
AddAppProperty "AppTitle", dbText, "Zfile Medical Database System"
Application.RefreshTitleBar
'Application.SetOption tobreakonerrors, 2
Exit Sub
End Sub

Regards,
Al
 
"Al Borges" <alborgmd at yahoo dot com> wrote in message

(snip)
here are my setup
properties- be careful when you use them- if you change the 'ChangeProperty
to ChangeProperty (i.e. remove the single quote) on certain lines, you could
make your database permanently CLOSED to further programming:


Not true. Any member of the Admins group can open the database (through
code) & change the database properties back to whatever he/she wants.

TC
 
Gosh, you're right! It's a difficult feat, though, and if you distribute an
*.mde database of course, it should become a moot issue.

Regards,
Al
 
Back
Top