T
TotallyConfused
I just finished working on a form where I had to add a function that is
Module 2 below. However, I had in my database a Utilities Module (copy
below). When I run one of my form/report I get the following message: "The
expression contains an ambiguous name. You may have two or more functions
with the same name in different modules. Rename the function so that each
one has a unique name." At first I thought it was the same function, but
they are different. How can I fix this with jeopardizing my database?
thank you in advance for any help you can provide.
Utilities Module
Option Compare Database
Option Explicit
Function IsLoaded(ByVal strFormName As String) As Integer
' Returns True if the specified form is open in Form view or Datasheet view.
Const conObjStateClosed = 0
Const conDesignView = 0
If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <>
conObjStateClosed Then
If Forms(strFormName).CurrentView <> conDesignView Then
IsLoaded = True
End If
End If
End Function
Module 2
Option Compare Database
Function IsLoaded(ByVal strFormName As String) As Boolean
Dim oAccessObject As AccessObject
Set oAccessObject = CurrentProject.AllForms(strFormName)
If oAccessObject.IsLoaded Then
If oAccessObject.CurrentView <> acCurViewDesign Then
IsLoaded = True
End If
End If
Module 2 below. However, I had in my database a Utilities Module (copy
below). When I run one of my form/report I get the following message: "The
expression contains an ambiguous name. You may have two or more functions
with the same name in different modules. Rename the function so that each
one has a unique name." At first I thought it was the same function, but
they are different. How can I fix this with jeopardizing my database?
thank you in advance for any help you can provide.
Utilities Module
Option Compare Database
Option Explicit
Function IsLoaded(ByVal strFormName As String) As Integer
' Returns True if the specified form is open in Form view or Datasheet view.
Const conObjStateClosed = 0
Const conDesignView = 0
If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <>
conObjStateClosed Then
If Forms(strFormName).CurrentView <> conDesignView Then
IsLoaded = True
End If
End If
End Function
Module 2
Option Compare Database
Function IsLoaded(ByVal strFormName As String) As Boolean
Dim oAccessObject As AccessObject
Set oAccessObject = CurrentProject.AllForms(strFormName)
If oAccessObject.IsLoaded Then
If oAccessObject.CurrentView <> acCurViewDesign Then
IsLoaded = True
End If
End If