Hi, in my Access 97 database, I have the following codes in module named "ModTest":
Dim db As Database, mod1 As Module, appcurr As Application
Set db = CurrentDb()
Set appcurr = Access.Application
For Each mod1 In appcurr.Modules
If mod1.name Like "ModFAC*" Then
docmd.copyobject "d:\db1.mdb","",acModule,mod1.name
else
MsgBox mod1.name
End If
Next
End Function
It returned me a message box "ModTest", which is not what I want to do.
I mean to check all the modules'names in my database. However, it seems that this script only checks the current open module. Is this caused by my definition of "appcurr", which is current Access.Application? What part of scripts is not right?
Much thanks in advance.
Dim db As Database, mod1 As Module, appcurr As Application
Set db = CurrentDb()
Set appcurr = Access.Application
For Each mod1 In appcurr.Modules
If mod1.name Like "ModFAC*" Then
docmd.copyobject "d:\db1.mdb","",acModule,mod1.name
else
MsgBox mod1.name
End If
Next
End Function
It returned me a message box "ModTest", which is not what I want to do.
I mean to check all the modules'names in my database. However, it seems that this script only checks the current open module. Is this caused by my definition of "appcurr", which is current Access.Application? What part of scripts is not right?
Much thanks in advance.