none
how to avoid changing the custom categories and groups on the Microsoft Access 2010 navigation pane when I get connected through vbs script? RRS feed

  • Question

  • I have an acccess database with many tables. I created many groups and custom categories on the navigation pane to work more easily. For some specific reasons, I need to open, run some macros, and close the Access database through a vbs script.

    When I open manually the Access database after running the vbs script, many tables are not longer on their custom categories and groups on the navigation pane, and assigning again the tables to the groups is quite a long task.

    Is there a way to get connected to the Access database through vbs without modifying the custom categories on the navigation pane?

    Thank you very much for your time,

    FYI, the script I use to connect the database through vbs is here below:

    set accessApp = CreateObject("Access.Application")
    accessApp.OpenCurrentDatabase "C:\DATABASE.mdb"
    accessApp.DoCmd.RunMacro "MACRO I WANT TO RUN FROM VBS SCRIPT"
    accessApp.CloseCurrentDatabase
    accessApp.Quit
    set accessApp = nothing

     

    Thursday, October 1, 2015 4:08 PM

Answers

  • Hi,

    Thank you very much for your interest. I guess that something wrong happens and the database corrupts slightly and thats why it looses groups on the navigation pane.

    Fortunately, I discovered that there is an option to import the custom groups on the navigation pane from other access database (in the same menu used to import tables, there is a button "options" and you can select to import the groups on the navigation pane).

    Therefore, I have a backup access database, and once I run the vbs script I import the navigation pane from this backup database, it is not perfect, but it works for me.

    Thanks again!

    Josu

    • Marked as answer by jooosu Monday, October 12, 2015 10:18 AM
    Monday, October 12, 2015 10:18 AM

All replies

  • You are posting to a Visual Basic .NET forum and this is more of a Microsoft Access question. I would either re-post your question to the Access for Developers forum, or perhaps a moderator can move the question there.


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Thursday, October 1, 2015 5:58 PM
  • Hi Jooosu,

    As far as I know, there is no such Object we can manipulate the custom group in Access object model. You can get more detail about it from link below:
    Object model (Access VBA reference)

    Based on my understanding, when we automation Access via Access object model, it won't change the custom group. Please check the macro to see whether it corrupt the database. If you still have the problem, would you share more detail to help us reproduce this issue?

    Hope it is helpful.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 5, 2015 3:09 AM
    Moderator
  • Hi,

    Thank you very much for your interest. I guess that something wrong happens and the database corrupts slightly and thats why it looses groups on the navigation pane.

    Fortunately, I discovered that there is an option to import the custom groups on the navigation pane from other access database (in the same menu used to import tables, there is a button "options" and you can select to import the groups on the navigation pane).

    Therefore, I have a backup access database, and once I run the vbs script I import the navigation pane from this backup database, it is not perfect, but it works for me.

    Thanks again!

    Josu

    • Marked as answer by jooosu Monday, October 12, 2015 10:18 AM
    Monday, October 12, 2015 10:18 AM