hope this helps anyone here,
VBA to compact and repair then close access.
Private Sub CloseFormcmd_Click()
SendKeys ("%T D C")
DoCmd.Quit
End Sub
hope this helps anyone here,
VBA to compact and repair then close access.
Private Sub CloseFormcmd_Click()
SendKeys ("%T D C")
DoCmd.Quit
End Sub
Avoid any use of Sendkeys.
And there is a setting option to automatically compare/repair the database on close.
i didnt know the, can you show me were that feature is please, i could only find to close the database and not the whole of access.
Doh i found the setting thank you for the advice :-)
Please explain.Avoid any use of Sendkeys
ThanksJwhite:-)
@aytee - basically because sendkeys is unreliable, particularly in a production environment, and does not respect which application window it is in - so user might inadvertently change focus to another app/window and the keys will be applied there instead - possible with disastrous results.
Thanks, Ajax, great explanation.