Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help With RunCommand Method Constants? ((a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I

  2. #2
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help With RunCommand Method Constants? ((a2k (9.0.6926) SP-3 Jet 4.0 S

    John,
    You can compact the database using the CmpactDatabase metod of the DBEngine object:

    DBEngine.CompactDatabase "cld.mdb","c:new.mdb"
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Help With RunCommand Method Constants? ((a2k (9.0.6926) SP-3 Jet 4.0 S

    Also see Compact the Current Database from Code on the Access Web.

    I don't think there is a VBA equivalent of Help | Detect and Repair, it's meant to be interactive.

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help With RunCommand Method Constants? ((a2k (9.0.6926) SP-3 Jet 4.0 S

    Hans & Jeremy

    Thank you

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help With RunCommand Method Constants? ((a2k (9.0.6926) SP-3 Jet 4.0 S

    What I'm trying to do is build a table driven Menu Bar at db startup, so I want them to work interactively in place of the buildt-in-toolbar

    For others that are interested your solution to previous post also works for other items on Menu Bar (built-in-toolbar), or at least till Microsoft renames them

    <pre>Function Menu_RepairDatabase()
    On Error GoTo Error_Handler

    If CheckPassword = True Then
    CommandBars("Help"). _
    Controls("Detect and Repair..."). _
    accDoDefaultAction
    End If

    Exit_Function:
    Exit Function

    Error_Handler:
    MsgBox Error$
    Resume Exit_Function

    End Function
    </pre>



    <pre>Function Menu_SwitchboardManager()
    On Error GoTo Error_Handler

    If CheckPassword = True Then
    CommandBars("Menu Bar"). _
    Controls("Tools"). _
    Controls("Database Utilities"). _
    Controls("Switchboard Manager"). _
    accDoDefaultAction
    End If

    Exit_Function:
    Exit Function

    Error_Handler:
    MsgBox Error$
    Resume Exit_Function

    End Function
    </pre>


  6. #6
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help With RunCommand Method Constants? ((a2k (9.0.6926) SP-3 Jet 4.0 S

    <img src=/S/cool.gif border=0 alt=cool width=15 height=15> Glad to see you got something that works, and thanks for the info!! <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •