45 pts.
 Add module to remote access database
I have 100+ access 2000 .mdb's that I need to add a specific module to. What I want to do is loop through all mdb files in a specific directory and add a standard module to each one. Any ideas as to how to accomplish this from within access vba would be appreciated. I intend to do this from within a separate access mdb

Software/Hardware used:
ASKED: June 28, 2008  5:53 PM
UPDATED: August 30, 2008  2:04 AM

Answer Wiki:
I know this is late, but hopefully this will help someone. Here is some code that will get you started. If you want to iterate through a folder, working on each MDB file (or any file for that matter), here's some sample code using Scripting Runtime library. I'm assuming that the folder contains a mix of mdb and other files. (make sure to set a reference to Microsoft Scripting Runtime) Sub LoopThroughFiles() Dim strFiletype As String Dim strMyFilename As String Dim fso As Scripting.FileSystemObject Dim objFile As Object Const strFolder As String = "C:" ' replace this with the path to the folder Set fso = New Scripting.FileSystemObject For Each objFile In fso.GetFolder(strFolder).Files strMyFilename = objFile.Name strFiletype = Right$(strMyFilename, 3) If UCase$(strFiletype) = "MDB" Then ' your code to add a module here End If Next objFile End Sub
Last Wiki Answer Submitted:  August 30, 2008  2:04 am  by  JP2112   475 pts.
All Answer Wiki Contributors:  JP2112   475 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _