S
Steve
I am making a maintenance routine to compact and repair the database
automatically once a week. I had it working in Access 2003 perfectly, but I
need to get it working in Access 2007 now. I tried sendkeys with %(FMC), but
this does not work when called from the maintenance code. It will work if I
have it on the onclick event for a button, but not when I call it from my
maintenance routine. In Access 2003 I used the code below called from the
maint routine and it worked perfectly.
Function CompactDB()
CommandBars("Menu Bar").Enabled = True
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
End Function
Is there an equivalent in Acces 2007 I can use. If not, is there another way
to code this in VBA to automatically compact & repair the current db?
Thanks
Steve
automatically once a week. I had it working in Access 2003 perfectly, but I
need to get it working in Access 2007 now. I tried sendkeys with %(FMC), but
this does not work when called from the maintenance code. It will work if I
have it on the onclick event for a button, but not when I call it from my
maintenance routine. In Access 2003 I used the code below called from the
maint routine and it worked perfectly.
Function CompactDB()
CommandBars("Menu Bar").Enabled = True
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
End Function
Is there an equivalent in Acces 2007 I can use. If not, is there another way
to code this in VBA to automatically compact & repair the current db?
Thanks
Steve