How to Find specific database object

BJS

Registered User.
Local time
Today, 01:15
Joined
Aug 29, 2002
Messages
109
I am wondering if there is a quick way to find a database object (table, query, form, report) other than having to scroll through them in the database window.

E.g. I have many many queries and when I need to find one to make changes to it, it often takes me a while to find it when scrolling thru the queries in the database window.

Has anyone ever programmed anything whereby you can type in the object type and name and then it will be highlighted in the database window?

This would be a great time saver.

Thanks,
BJS
 
In all my years of using Access, I have never used the Object Browser!

Thanks for the tip, Ken! :)
 
So, I just became familiar with the object browser, but it does not quite do what I am looking for.

For example: If I have 200 tables in my database, and I need to find one of them so I can make a design change to it, it takes long to scroll through all the tables in the database window to find it. Unless I am not using the object browser correctly, I find that it does not find tables or queries, only objects with code attached to it.

Instead, I created a simple form with a text box (used to enter the name of the table, query, report, or form), option buttons (optTable, optQuery, optReport, optForm) and a button with the following code:

Code:
Dim obj As Object
    Set obj = Me.txtObjName
    
    If Me.optQuery = True Then
        DoCmd.SelectObject acQuery, obj, True
    ElseIf Me.optTable = True Then
        DoCmd.SelectObject acTable, obj, True
    ElseIf Me.optReport = True Then
        DoCmd.SelectObject acReport, obj, True
    ElseIf Me.optForm = True Then
        DoCmd.SelectObject acForm, obj, True
    End If

The form allows me to select the type of object I am looking for and enter the name of the object. When clicking on the button, it will take me to that exact object in the database window. THIS DOES THE TRICK, BUT.....

Does anyone know of a way to do this if you only know part of the object name? E.g.: The actual table name is: tblCustomerOrders....but since I can't remember the exact name, I would like to enter in my text box the object name "customer" and it should find the first table containing this name and then allow me to continue searching until the program selects the table I actually want.

Has anyone ever done this? I would appreciate your ideas!

BJS
 
I think you would have to loop the proper collection doing something like an INSTR on the names to detect it.
 
Thanks for the tip, FoFa.
I will play with that and see if I can get it going.
 
Aren't these in one of the sys tables?
 
I thought they might be, but I could it find it as such. Not sure where access keeps it's collection information.
 

Users who are viewing this thread

Back
Top Bottom