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

HIde Form from another form

Status
Not open for further replies.

bluegnu

Technical User
Sep 12, 2001
131
0
0
GB
I have a form which has a button on it which opens another form. When this happens I want to be able to hide the form with the button on it, but I can't work it out.

I have used forms![Myform].visible = false and that doesn't work.

Any help is appreciated.
 
bluegnu, before you open then new form, set the current form unvisible

Code:
Me.Visible = False

and then open TheNewForm you want

Code:
DoCmd.OpenTable TheNewForm, acViewNormal, acEdit
 
Is it possible for this to work in the OnLoad event. I can get it to work on the button OK, but I'd also like it to work on the Onload. I have an If/Then query which I'd like it to work with. The If statement opens the other form if the value of a field is greater than one, but when I put the Me.Visible = False in the If statement as well, it doesn't work.
 
bluegnu,

You open form1, the if statment checks a field of the returning query if it is grater than 1 and on true hides form1 and shows form2???

Why don't you do the check before loading any form and then choose which form(1 or 2) to show?!
 
OK. When the database opens a form is opened with the date on. This form then checks to see if more than one user is logged in. If only one user is logged in they are asked to check the date because the PC's they use aren't necessarily on the correct date.

If there are more than one user logged in the form opens the main search form and should go hidden because I want that date form to stay in the background as it is used in many other form fields.

But what happens is, the search from is opened, but the date form also remains visible and on top.

Any ideas?
 
Don't suppose anyone can help with this?

many thanks
 
I was originally, but I changed that. I just can't work out why it isn't working.

I'm using Access 97 in case that is of any significance.
 
Try your code in the On Current event. To hide the form.

Life's a journey enjoy the ride...

jazzz
 
If you want to make the first form visible try using Forms(0).Visible = True in the onload event in your second form.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top