IF Exist Object

FloBob

Registered User.
Local time
Today, 15:28
Joined
Jul 19, 2002
Messages
108
I woudl like to see if I can find a piece of code that will tell me if a module exists in a database. Such as:

if findobject(Module1) = true then
'whatever
end if

anyone know how to do this? Thanks
 
Public Function CheckModule(strModName As String) As Boolean
Dim objMod As Object

For Each objMod In Application.CurrentProject.AllModules
If objMod.Name = strModName Then ' strModName Then
CheckModule = True
End If
Next
End Function

Must pass strModName. Returns True if it exists, False if it doesn't exist in the current project.
 
Last edited:
Dont know why... I was looking for a built in function but this should work great... Thanks a bunch.
 

Users who are viewing this thread

Back
Top Bottom