back to main menu

  • Thread starter Thread starter paul
  • Start date Start date
P

paul

Hi,
I have an Access 2000 application, I open Main Menu,
select a Query Menu form, select another Query Input form,
display the Query result form, Now how do back to my Main
Menu?
I tried to open the Main Menu, but it can only back to
previous form. So after open several forms, how to move
back to one particular form?
Thanks a lot.
 
Paul,

Are you closing each of the menu forms as you open the
next one or are you just opening the next form?

I you are closing the "Main Menu" then you should be able
to just Open it from a command button.

If you are not closing it and the other forms then you
will need to deal with that differently.

Provide a little more info and I'll try to help.

HTH

Byron
 
-----Original Message-----
Paul,

Are you closing each of the menu forms as you open the
next one or are you just opening the next form?

I you are closing the "Main Menu" then you should be able
to just Open it from a command button.

If you are not closing it and the other forms then you
will need to deal with that differently.

Provide a little more info and I'll try to help.

HTH

Byron

.
Hi Byron,
I just open the next form. I have several command
button, some can go back to previous, some can go back to
Main Menu. I don't have this problem when I maximize the
form, this Morning I removed the maximize.
Thnaks.
 
-----Original Message-----
Paul,

Are you closing each of the menu forms as you open the
next one or are you just opening the next form?

I you are closing the "Main Menu" then you should be able
to just Open it from a command button.

If you are not closing it and the other forms then you
will need to deal with that differently.

Provide a little more info and I'll try to help.

HTH

Byron

.
Byron,
On my command button "Main Menu", is there a way i can
check any forms still open & then closed all the forms, so
I can back to Main Menu.
Thanks.
 
Paul,

The short answer is, "Yes," you can check to see if a
form is open.

I find that in some cases I may even open the same form
from different menus or from other forms. Therefore, I
would suggest that in those cases you can use
the "OpenArgs" argument when opening a form. Basically
this argument option lets you send information that you
can later check for, when you are opening a form. (Check
the help file to get more details on this.)

In any case, to check to see if a form is open, first
copy the function below to a module (not the module of a
form).

****** function code starts here ******
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

****** end of function code ******


Next, in the OnClose event of any form, you can call the
function like:

****** code starts here ******

If Me.OpenArgs = "frmMainMeun" Then
If IsLoaded("frmMainMeun") Then
Forms!frmMainMeun.Visible = True
Else
DoCmd.OpenForm "frmMainMeun"
End If
End If

****** end of code ******

By the way, the first line of this code is only checking
to see if the from was opened from the Main Menu, having
used the "OpenArgs" argument. You could just as easily
use a Select Case statement to evaluate the value of
the "OpenArgs" if you knew that you were going to open
the same form from multiple calling locations.

If you only want to check to see if the "frmMainMenu"
form is open, then just remove the first "IF" statement
and it's "EndIF".

HTH

Byron
 
Back
Top