Link to home
Start Free TrialLog in
Avatar of Yaniv Schiff
Yaniv SchiffFlag for United States of America

asked on

modify access table custom group property

in Access 2007 there is the ability to add objects to custom created groups, for easy navigation. If i already have the groups created (say "group1", "group2", etc...) how do i go about setting this property for individual tables through vba?
Avatar of conagraman
conagraman
Flag of United States of America image

it looks like there are a couple of ways to do this.  first here is the link to the msdn website that talks about customizing the navigation panel.
http://office.microsoft.com/en-us/access-help/view-and-manage-objects-by-using-the-navigation-pane-HA001213879.aspx#BM6

here is what it says about adding objects to a custom group


option 1:     <<"To add or move objects in the database into a custom group, click the drop-down arrow at the top of the Navigation Pane, and then click the custom group that you created.
    * Under Unassigned Objects, right-click the object that you want to add or move.
    * Click Add to group on the shortcut menu, and then click the custom group that you want to add the object to.">>


Option 2:
<<"Copy and paste objects

    * In the Navigation Pane, right-click the object that you want to copy, and then click Copy.
    * Right-click the group in the Navigation Pane where you want to paste the object, and then click Paste. You can also paste the object in the Navigation Pane of another database that is open in Office Access 2007.">>

hope this helps
Avatar of Jeffrey Coachman
IMHO, it would be easier to put these items in a menu.

Remember, users should only be interacting with application through forms.
They should not really have access to the navigation Pane or any "Groups"

Just my 2c

;-)

JeffCoachman
Avatar of Yaniv Schiff

ASKER

Thanks for the replies, i am hoping to do this through VBA. This is more of a database template that get's copied down from the network and new tables get created in it, so manually adding the tables to the user groups is not really an option.
Ah, OK,  thanks for the clarification.

I'll let you continue with conagraman

JeffCoachman
ok forensicon

what i have been able to come up with is that there is no built in command for what you want to do.
however there is a way other than the UI.

 this is going to take some playing around with on your part but you can change the system tables.
****************** warning! you can mess up your database doing this **********

below is a sample database to play around with
choose your table choose your category then press group.  
*** i dont know why but after you press the group key close the form and press your  F5 (refresh key) then go back into your form
- its going to take some work on your part but this should get you in the right direction.

hope this helps

test.accdb
Sorry, haven't looked at this in a while. I'm not really sure what to do with this though. Let me clarify what i'm looking for i guess. I have a database template get copied down for different cases we work on. There are no tables in the db to begin with. There are a bunch of vba scripts included in it. These scripts get run and tables get created automatically. I want these tables to get their "group" property automatically assigned when they get created. Does this make sense?
Forensicon


i have made a database and worked with this idea a little more.

*first off the more i think about this i would suggest just making a table of all the newly created tables.
i kept going with this because i was interested in it as well
i have included a database with the code and it is noted for further information.

when you open the database up and press the button what is happening is it
1: creates a new table
2: adds a new record to the system table "MSysNavPaneGrouptoObjects" with the needed data

the only thing is i can’t get the navigation pane to refresh correctly. after the code is finished running the table will have been grouped but you may have to press F5 and close/reopen the form to see the effect. there may be a command to refresh the navigation pane but i have not found it yet.

hope this is what you wanted
ASKER CERTIFIED SOLUTION
Avatar of conagraman
conagraman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have provided the logic and a sample database.
Once a new table is created the system tables have to be modified.
I believe this question has been answered sufficiently.
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.