Opening/minimising/hiding

nadsys

Registered User.
Local time
Today, 13:30
Joined
Apr 22, 2005
Messages
18
hello, i have 7 forms, each of which is opened by a main form. on the main form is 7 buttons which should each open a different form. on opening this form the main form should hide/minimise and the opened form should come to the front and be visible. on closing the form the main form should come back into view

i have tried frmName.Show, frmName.Visible, frmName.minimize and so on but just cant get these things to work, using them on events such as OnLoad of the new form and OnClick of the button.

always just get error etc, can anyone provide me with a procedure to do this sort of thing.

Thank You
 
You should close the main menu form when the user clicks a button to open one of the seven forms. The other forms should have a button that the user has to click to close the form. Within the OnClick event to close the form the main menu form should be opened. Something like this should get you started...

Code:
    DoCmd.OpenForm "form1", acNormal, "", "", acEdit, acNormal
    DoCmd.Close acForm, Me.Name
 
thank you

many thanx, code worked like a dream.

question which now begs to be asked is "what do all those terms mean. i have a VB book but find no mention of thos "ac" type terms. is there a website with all possible options to choose from etc?

also, on "docmd.close acform, me.name" i dont understand the logic. docmd.close acform says close current form, ok. then me.name?

on second thought, logic might just have hit me "close TYPE acform, with name of current form (me.name), guessing name = form name". odd logic but i suppose works.
 
The built-in Access help files for VBA is pretty good. Just hi-lite the keyword in the code that you question and press the F1 key to find the answers to your quest.

The Me.Name refers to the form that called the code. Keeps coding simple since you do not have to type the string name for the specific form.
 

Users who are viewing this thread

Back
Top Bottom