Search for field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a fairly large database that I just started using. I was wondering if
there was a way to search the whole database for a specific field name so I
know which table I should look in for this data. Does anyone know if this is
possible?

Thanks!

Dawn
 
The following routine will list the tables in the Immediate window:

Public Sub FindFieldName(strFieldName As String)
Dim tdf As DAO.TableDef, fld As DAO.Field, db As DAO.Database
If strFieldName = "" Then Exit Sub
Set db = CurrentDb
For Each tdf In db.TableDefs
For Each fld In tdf.Fields
If fld.Name = strFieldName Then
Debug.Print tdf.Name
End If
Next
Next
Debug.Print "I'm Done"
Set db = Nothing
End Sub

Place the routine in a standard module and call it from the Immediate window
with this syntax:

FindFieldName "FieldName"

then press Enter. The tables will be listed below the line you entered. If
nothing is found, you'll still get the "I'm Done" statement.
 
I have a fairly large database that I just started using. I was wondering if
there was a way to search the whole database for a specific field name so I
know which table I should look in for this data. Does anyone know if this is
possible?

Thanks!

Dawn

There are some good third-party tools to do this; it's not easy in
native Access.

Free: http://www3.bc.sympatico.ca/starthere/findandreplace
Find and Replace: http://www.rickworld.com
Speed Ferret: http://www.moshannon.com
Total Access Analyzer: http://www.fmsinc.com


John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top