Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tricky Form Questions 1

Status
Not open for further replies.

RandyMyers

IS-IT--Management
Apr 28, 2004
85
US
1) I am trying to open a form from a variety of queries depending on values in another popup selection form. I know I can have duplicates of the form based these variety of queries and have a macro determine which one to open from the popup, however, I would prefer to have only one form because of my next question...

2) Is there any way to determine if a form is already open, visible or not... The reason for this is that I would like to keep a search form open so that it can be returned to, remaining populated with the original search values. When selecting a record to do detail work I would like to either move this form to the background or make it invisible (visible = false) and then closing the detail form either bring this form fore front or make it visible again (so that the original searched records would still be displayed and able to be clicked on for detail).

Do these questions make sence? Any idea how to accomplish this?

Thank you ahead of time for your ideas.
 
Hi
From the code library:
Code:
Function IsLoaded(ByVal strFormName As String) As Boolean
 ' 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

That should take care of determining if the form is open. I think you said you had part one worked out?
 
Yes,

I did figure out how to switch queries to open a form with. Use different queries to filter a form in a macro seems to work good.

Thank you...
 
This did work. Thank you! It took me some time to figure out how to integrate it into the system, but after that hurdle was crossed it works like a charm.

Thanks again...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top