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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make Form Visible When Query Closed

Status
Not open for further replies.

hext2003

Technical User
Oct 9, 2006
119
US
I have a form that gathers Parameters for a query.

I press a Search Button and I have code that sets my Form Visible = false and Shows the Query

If Someone Click on the X to close the Query I want the Form to be visible again.

How do I do that??? is it Possible? Where do I program this?

TIA
 
You should be able to use the timer event of the form.

Here is some sample code.

Code:
Private Sub Form_Timer()
intObjType = acQuery
strObjName = "Query1"
vS = Application.SysCmd(acSysCmdGetObjectState, intObjType, strObjName)
If vS = 0 Then Me.Visible = True
End Sub

Private Sub cmdShowQuery_Click()
    
    Me.Visible = False
    Me.TimerInterval = 100
    DoCmd.OpenQuery "Query1"
    
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top