G
Guest
Hi all
I have written a function called FormIsOpen to test whether a form is
currently open and put it in a module. The function code is as follows:
Function FormIsOpen(FormName As String) As Boolean
Dim AnyForm As Form
For Each AnyForm In Forms
If (AnyForm.Name = FormName) Then
FormIsOpen = True
Exit For
End If
Next AnyForm
End Function
The database is in 2000 format. I have moved it to a machine running Access
2003 (but not updated it 2003). Now, whenever the function is called, I am
told Access has to close and apologised to for the inconvenience.
If I replace the function call with lines of code to perform the same
operation, it works fine.
Can anyone tell me what is going on here?
Many thanks
David Cleave
I have written a function called FormIsOpen to test whether a form is
currently open and put it in a module. The function code is as follows:
Function FormIsOpen(FormName As String) As Boolean
Dim AnyForm As Form
For Each AnyForm In Forms
If (AnyForm.Name = FormName) Then
FormIsOpen = True
Exit For
End If
Next AnyForm
End Function
The database is in 2000 format. I have moved it to a machine running Access
2003 (but not updated it 2003). Now, whenever the function is called, I am
told Access has to close and apologised to for the inconvenience.
If I replace the function call with lines of code to perform the same
operation, it works fine.
Can anyone tell me what is going on here?
Many thanks
David Cleave