Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to go to the previous menu

Posted on 1999-10-04
10
Medium Priority
?
199 Views
Last Modified: 2010-05-02
When i am going thru MENU to a form, i want to be in the same place when i come out of the form. But the menu takes me to top. How can i goto the last menu.

thanks in advance
0
Comment
Question by:ackid32
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 2099516
You may just save your form coordinate in registry and retrieve back when you need.

?->
0
 
LVL 4

Expert Comment

by:Juilette
ID: 2099686
use a popup menu and call the menu from the exit of the form you are visiting.
0
 

Accepted Solution

by:
pakku earned 200 total points
ID: 2099722
Try this. This app. has one module & three forms.

'*************************
' Beginning of Module1
'*************************
Option Explicit
Public strMenu As String

'**********End of Module1 *************

'******************************************************
'Beginning ofForm1. This form contains two menus namely
'File & Edit similar to Visual Basic system menu.
'******************************************************
Option Explicit

Private Sub Form_Activate()

    If strMenu <> "" Then SendKeys strMenu
    strMenu = ""
   
End Sub
Private Sub mnuEditCantRedo_Click()
    Form3.Show
End Sub
Private Sub mnuEditCantUndo_Click()
    Form3.Show
End Sub
Private Sub mnuEditCopy_Click()
    Form3.Show
End Sub
Private Sub mnuEditCut_Click()
    Form3.Show
End Sub

Private Sub mnuFileAdd_Click()
    Form2.Show
End Sub
Private Sub mnuFileNew_Click()
    Form2.Show
End Sub
Private Sub mnuFileOpen_Click()
    Form2.Show
End Sub
Private Sub mnuFileRemove_Click()
    Form2.Show
End Sub

'**************End of Form1*************

'******************************************
'Beginning of Form2. Has a command button
'******************************************
Option Explicit

Private Sub Command1_Click()
    Unload Me
    strMenu = "%{F}"
End Sub

'**************End of Form2*************

'****************************************
'Beginning of Form3. Has a command button
'****************************************
Option Explicit

Private Sub Command1_Click()

    Unload Me
    strMenu = "%{E}"

End Sub





0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 4

Expert Comment

by:Juilette
ID: 2099825
Looks like a ong version of what I suggested prior.
0
 

Expert Comment

by:pakku
ID: 2100549
Regarding my code above, I would like to mention a couple of points.
I am not creating pop up menus. Instead I am just invoking the main menu options using their corresponding Access Keys using the SendKeys statement.
0
 
LVL 4

Expert Comment

by:Juilette
ID: 2100861
same diff...a menu is a menu...it was a suggestion..you want to return to the menu so why not just to the menu..ie a popup...
I'm sure you'll work it out.
0
 

Author Comment

by:ackid32
ID: 2102134
hi, pakku! what happens if im click on other menu directly?
0
 

Expert Comment

by:pakku
ID: 2102216
About Juilette's comments:

I do agree that Pop up menus is one of the solutions.
But with Pop up menus we will not see the same effect as that of clicking on the main menu. Also the developer has to break his head on the pop up menu locations.

Where as with Send Keys you are just triggering the Menu Click event. I tried with both Pop up menus & SendKeys. I feel that this is more efficient than Pop up menus. My request is to try both and see the difference.

Also if possible kindly send me the code with pop up menus if you get the same effect as with Send Keys. I could do not get it.

About Ackid32's comment:

Let me explain how the app works. I have two menus File & Edit in the main form Form1. For File menu Alt F is the Access Key & for Edit Menu Alt E is the access key.

Clicking on any of the menu options in the File menu shows Form2.
If you close Form 2 the app sends Alt F key code to Form1. This results in the File menu display when you return to
Form1 from Form2.

Similary if you click on any of the edit menu options it will show Form3.  Closing Form3 sends ALT E key code to Form1. This results in the Edit menu display when you return to Form1.

To summarize:

Ensure that you have Access Keys for all the main menu options in the Main Form.
When u call a child form from a menu option, ensure that on closing the child form, you return the corresponding Access Key combination to the main form. Use a global variable to achieve this. (In our case 'strmenu' is the global variable)
Note that SendKey statement has to be used in Form Activate event of main form.

It should work for all menus. Please try with this code & let me know if u face any problems.

Thanks
Prakash


0
 

Author Comment

by:ackid32
ID: 2106570
ok
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6857214
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question