Syscmd in Access

I am trying to determine if a form is open so i can perform a certain task. To do that i am running the syscmd. It works in certain places fine but not with this one scenario. This is the function i have set up.
Function IsFormOpen(sForm As String) As Boolean
If SysCmd(acSysCmdGetObjectState, acForm, sForm) = acObjStateOpen Then
  IsFormOpen = True
ElseIf Not SysCmd(acSysCmdGetObjectState, acForm, sForm) = acObjStateOpen Then
  IsFormOpen = False
End If

The acSysCmdGetObjectState is returning a value of 10? If i understood the help file does not even say that is an option?

here is the scenario

On Form A - Update form. Press a Button to :
Call Form B - Search form. Search Button
Calls Form C Search results form. Checks to see if B is open if yes closes Form B. this works
Append button on Form C checks to see if they have Form A still open. If yes then append data if No then msgbox. this does not work.

Any Idea's

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
here is the sample code from the northwind db

Public Function IsLoaded(ByVal strFormName As String) As Integer
' From Northwind sample database:
' Returns True if the specified form is open in Form view or Datasheet view.
' These variables are used to test the return values of the SysCmd function
'  and the CurrentView property of the requested form.
    Const conObjStateClosed = 0
    Const conDesignView = 0

    'The first If statement uses the SysCmd function to check the current
    'state of the requested form. It can be in one of four states: not open
    'or nonexistent, open, new, or changed but not saved.
    If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then
        'The second If statement checks for the current view of the requested
        'form, assuming the previous If statement found it to be open. If
        'the form is currently open in Form View, the function will return
        'true. If the form is in Design View, the function will return false.
        If Forms(strFormName).CurrentView <> conDesignView Then
            IsLoaded = True
        End If
    End If
End Function

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.