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

Check what form not visible

Status
Not open for further replies.

fule12

Programmer
Nov 12, 2001
140
YU
Hi All,

I create two MainMenus Form (UserMenu and AdminMenu).On both Menu Forms I have buttons what open same forms (search and Add/Edit File). Now if I open Search form than Mainmenu form is invisible, far so good. But on close event of Search form how to define with form was hiden (UserMenu or AdminMenu) ?

On Close Event for Search and Add/Edit File forms I create this code :

Private Sub Form_Close()
On Error GoTo err_FormMessage
If Forms!frmMainMenu.Visible = False Then
Forms!frmMainMenu.Visible = True
End If
If Forms!frmUserMenu.Visible = False Then
Forms!frmUserMenu.Visible = True
End If
Exit_formMessage:
Exit Sub
err_FormMessage:
If Err.Number = 2450 Then
Resume Next
Else
MsgBox Err.Number & Err.Description
End If
Resume exit_formMessage

End Sub
---------------------------------
But I don't think this is right approach

any ideas?

Thanks

Fule
 
You might try putting the name of the form (either MainMenu or UserMenu) in the .Tag property of the Search form when either of those two menuform activate the Search form.

In the OnClose event of the SearchForm, it can reference it's own .Tag property to see which form opened it, and therfore, which form to make visible.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top