none
Hiding an open table RRS feed

  • Question

  • For application startup I had to open a table as part of some DAO.recordSet code.

         DoCmd.OpenTable "User", acNormal, acReadOnly

    On running user tests, I want to distribute the desktop application as a run-time file (.accdr) but the access table is visible. All I can find regarding my query is how to hide navigation area objects.

    I, of course, do not want the table visible to users, so my question is how do I hide it?


    • Edited by MarcusKgosi Tuesday, June 6, 2017 8:25 AM Adding detail
    Tuesday, June 6, 2017 7:15 AM

All replies

  • Right click on the table in the list and select Table Properties. You should see a Hidden checkbox option that will enable you to hide the table from view.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Tuesday, June 6, 2017 12:06 PM
  • Typically, you hide the entire Navigation Pane and even the ribbon, and display your own custom menu to control what users have access to.  This way they don't have access to Table, Queries, ... at all.

     

    You may like to review the following articles:


    Daniel Pineault, 2010-2016 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net


    Tuesday, June 6, 2017 12:34 PM
  • For application startup I had to open a table as part of some DAO.recordSet code.

         DoCmd.OpenTable "User", acNormal, acReadOnly

    Why would you need to open the table, whether there's some recordset-processing code that handles it or not?  DoCmd.OpenTable is for presenting the table contents to a user as a datasheet.  I can't think of any reason why you would need to use that if all you were going to do was process the table's records in code.


    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    Tuesday, June 6, 2017 2:03 PM
  • Can you post the block of code that does your recordset processing, for context? Like Dirk, I'm guessing that the OpenTable command is not necessary.

    Miriam Bizup Access MVP

    Tuesday, June 6, 2017 2:52 PM
  • Hi MarcusKgosi,

    I try to make a test with below line of code.

    DoCmd.OpenTable "User", acNormal, acReadOnly

    I find that when we try to use code of line below or we hide the table from its property.

    Application.SetHiddenAttribute acTable, "tblOrders", False

    then I use your line of code to open the table. at that time you will find that table will be display on the screen.

    table only not display in navigation pane.

    so you try to hide the table or try to hide the navigation pane, table will be display when you run that line.

    so I suggest you to change this line of code and try to find alternative to fulfill your requirement and also not display the table.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, June 7, 2017 2:21 AM
    Moderator
  • That does not work.
    Wednesday, June 7, 2017 6:39 AM
  • Hi MarcusKgosi,

    I can see that you got suggestions by many community members.

    you posted a very short reply ,"That does not work."

    what does not work? which suggestion you try to implement?

    it is hard for us to know what you had tried.

    try to post detailed reply, so that we can try to provide you further suggestions.

    try to post , what you want to do after opening table.

    so that we can get proper idea.

    it is also helpful for us to provide you a better suggestion.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 8, 2017 1:24 AM
    Moderator
  • Could you explain further what exactly your are doing?  Show us your code?

    If you open a table, even a hidden (in the Nav Pane), it is visible to the end-user.  Then again, there is no reason to ever be opening a table.

    If you are trying to access the records within the table through VBA then you don't open the table, but rather turn towards the OpenRecordset method.

    Please provide us more information so we can better help you out.


    Daniel Pineault, 2010-2016 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Thursday, June 8, 2017 1:37 AM
  • Why would you need to open the table, whether there's some recordset-processing code that handles it or not? 

    It was an answer given in a forum and it solved the problem I was having at the time.

    Thursday, June 8, 2017 7:10 AM
  • That does not work.

    Sorry to hear that. If need further assistance please indicate where in Microsoft Access you see the table so that we can help you figure out how to hide it.


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Thursday, June 8, 2017 12:13 PM
  • Hi MarcusKgosi,

    from your last post , its like you got the solution for your other issue and it creates this issue.

    as we already inform you that hiding the table from property or with the use of code will not work here.

    to find any work around we need to code that you are executing after opening a table.

    so it is better if you post the code with as much as details. so that we can try to take care about your other solution and also find the solution for your current issue.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, June 9, 2017 2:33 AM
    Moderator