Programming the Favourite Group in Access 2000 container

arildr
arildr used Ask the Experts™
on
Hey. I have a problem, big one.

I have apprx. 600 tables, 900, reports, 1200, views +++

Everything is called the same way. ie. atbl_Contracts_Contract
afrm_Contracts_Contracts
arpt_Contracts_Contracts
amod_Contracts
stbl_Users_Users
stbl_Users_Logins

and so on...

I whant to make a progam to take all the objects. ie. tables, and make a group in the container called ie. Contracts and add all the objects that that contains _Contracts_ in its name.

How can I do that? Have looked around alot, but never found anything...

Please help!!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
For tables you can use a function like:

Function CreateTableField()
'Function to create a table/field table
Dim db As DAO.Database
Dim td As DAO.TableDefs
Dim tdx As DAO.TableDef
Dim rs As DAO.Recordset

Dim intI As Integer
Dim strTable As String

On Error GoTo err_CreateTableField

Set db = CurrentDb
Set td = db.TableDefs

' Create table. First drop existing table
'db.Execute "DROP TABLE tblTableNico5038;"

db.Execute "CREATE TABLE tblTableNico5038 (ObjectName TEXT, ObjectType TEXT);"

Set rs = db.OpenRecordset("tblTableNico5038")

For Each tdx In td
      strTable = tdx.Name
  For intI = 0 To tdx.Fields.Count - 1
      rs.AddNew
      rs!ObjectName = strTable
      rs!ObjectType = "Table"
      rs.Update
  Next intI
Next

End Function

This will even extract all the tablenames with their  objecttype (table/report/etc).

Need assistance for the other objects ?

Nic;o)

Author

Commented:
No I'll think you misunderstand. The point is to "tell" Access that I whant a "shortcut" from a spesific table to the favorites folder/group in the Access Contrainer (main window).

And how to do this by code...

Commented:
Hmm, I when you mean the IE favorites, then you could use the HyperlinkAddress Property to add them when detecting an instr(rs!ObjectName,"Contracts") > 0, but with your quantity this looks rather confusing for the user.

As far as I know you can't "containerize" tables within the table tab....

You could ofcourse create your own containers, but I guess that would complicate the handling....

Nic;o)
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
Hey, thanks for trying to help me:) But this is'nt the IE favourits. Lets skip tables then, and consentrate on forms and reports. There has to be a way of programming this!! Some way of saying that this form, i.e. afrm_Contracts_Contracts, should also be an shortcut in the Groups, witch I'll also create, named Contracts... The point of the program is tho create some groups, ie.Contracts, Users, Projects, DocControl, and add forms and reports to them according to the name of the object. Do you use Access 2000? In the container there you se something called Groups/Favourites. Understand what I'm saying:)? It's difficall to explain:(!!

Commented:
I have A97/A2000/A2002, but those Groups/Favourites in the container are new to me, I'll check them out tomorrow as it's past midnight here.

C U

Nic;o)

Author

Commented:
Thanks very much, here the clock is 10 AM, I'm in Singapore, Asia, doing a job. With Access:)

Commented:
Hmm, not really success full in my search for the groups.
How do you create a Group e.g. for Contracts ?

Nic;o)

Author

Commented:
Rightclick on ie. Modules in the list (forms, reports, modules...) to left in the database container windows and press on New group...

In Access 2000 and 2002

OK?

Commented:
Hmm, hard to get further as the:
DoCmd.RunCommand acCmdAddToNewGroup
that will open the input form for a new group.

All other references to groups I find are related with security and the USER GROUP :(

And in the object model there's also no separate "Group"...

I'll keep looking...

Nic;o)

Commented:

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts refunded
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
Per recommendation, points refunded and question closed.

Netminder
EE Admin

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial