Link to home
Start Free TrialLog in
Avatar of PSIUnit
PSIUnit

asked on

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



ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial