I have my Access 2007 database configured to use "Custom" groups in the navigation pane. I've grouped all my tables in a way that makes sense. However, whenever I update a link table, it loses its grouping.
I have not been able to find a way to avoid this. Since it seems to be unavoidable, I'd like to simply have a macro that adds the table back to the right group programatically. I have not found any examples on how to do this. Any suggestions?
Old thread, I know, but I just had to deal with this problem, and thought I'd share my solution: a function that will move an object to a group.
Public Function SetNavPaneGroup(strObjName, strGroupName)
Dim strSql, idObj, idGrp, db
Set db = CurrentDb
idObj = DLookup("Id", "MSysNavPaneObjectIDs", "Name='" & strObjName & "'")
idGrp = DLookup("Id", "MSysNavPaneGroups", "Name='" & strGroupName & "'")
If DCount("*", "MSysNavPaneGroupToObjects", "GroupID = " & idGrp & " AND ObjectID = " & idObj) > 0 Then
strSql = "UPDATE MSysNavPaneGroupToObjects SET GroupID = " & idGrp & ", Name='" & strObjName & "' WHERE ObjectID = " & idObj
db.Execute strSql, dbFailOnError
Else
strSql = "INSERT INTO MSysNavPaneGroupToObjects ( GroupID, ObjectID, Name ) " & vbCrLf & _
"VALUES (" & idGrp & "," & idObj & ",'" & strObjName & "');"
db.Execute strSql, dbFailOnError
End If
RefreshDatabaseWindow
Set db = Nothing
End Function
Enjoy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With