Very Interesting Request

  • Thread starter Thread starter deaconj999
  • Start date Start date
D

deaconj999

Hi all,

Does anyone know if it is possible to automate by way of a control on
a form, a way for a database to be compacted and reparied instead of
telling the inexperienced data base user how to select this fucntion
from the tools menu,

or

can it be automated by using a macro ?


Many thanks in anticipation

Joe Deacon ....... Knowledge expanding........
 
yeah totally

use Access Data Projects; SQL Server has 'Database Maintenance Plan Wizard'
and it is easy to use with SQL Agent in order to automate this type of stuff

MDB just requires too much maintenance for real world usage
 
G'day Deacon

You don't actually attach the hyperlink to the button, when clicked you
would have been redirected to the code you are looking for:

General: Compact Current Database
Author(s)
Juan M. Afan de Ribera


For Access 2000 and Access 2003. Here is a snippet of code for
compacting the current database. It uses the accDoDefaultAction method, that
performs the
specified object's default action, and can be run from a command
button on a form.

accDoDefaultAction is a method of the hidden IAccessible Class
in Office library.


' ***** Code Start *****
Public Sub CompactDB()

CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction

End Sub
' ***** Code End *****

Goto the buttons property
In the OnClick() paste the code

HTH
good luck.
Mark.
 
G'day Deacon

You don't actually attach the hyperlink to the button, when clicked you
would have been redirected to the code you are looking for:

General: Compact Current Database
Author(s)
Juan M. Afan de Ribera

For Access 2000 and Access 2003. Here is a snippet of code for
compacting the current database. It uses the accDoDefaultAction method, that
performs the
specified object's default action, and can be run from a command
button on a form.

accDoDefaultAction is a method of the hidden IAccessible Class
in Office library.

' ***** Code Start *****
Public Sub CompactDB()

CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction

End Sub
' ***** Code End *****

Goto the buttons property
In the OnClick() paste the code

HTH
good luck.
Mark.





begin 666 spacer.gif
K1TE&.#EA`0`!`(#_`,# P ```"'Y! $`````+ `````!``$```("1 $`.P``
`
end

I have no idea how this works, I keep getting an error that no macro
exists. The event procedure has it copied and pasted, please remember
I am still learning and would like a step by step guide.
 
Back
Top