I am very new with VB and am using Access2000 to try to find a Table in ALL mdb's located under Z:\ and look in all mdbs in all folders and subfolders. I need not to see information but to have someone actually help me with this code. There has to be a simple way to do this and keep this code to use a combo box and input into table. This code works well but I have several hundred databases I need to look for and too much to type in for every search. Thanks. :rolleyes:
Can someone help please.
Private Sub Form_Open(Cancel As Integer)
Dim strFile As String
Dim strPath As String
CurrentDb.Execute "DELETE * FROM tblTables"
strPath = "c:\"
strFile = Dir(Z:\ & "*.mdb")
While strFile <> ""
CurrentDb.Execute "INSERT INTO tblTables (TableName, DatabaseName) SELECT Name,'" & strPath & strFile & "' FROM MSysObjects IN '" & strPath & strFile & "' WHERE Name = 'bottling'"
strFile = Dir()
Wend
Me!Combo0.Requery
End Sub