Solved

Opning Form (frmXYZ.Show) - Is any alternate by passing form name as String?

Posted on 2001-09-13
4
186 Views
Last Modified: 2010-05-02
Hi Friends,

I am using VB Menu option to opening the screens from the MDI by giving the command FormName.Show.

I also stored the menu structure and form names in a table also.  Instead of pull down menu, i want to display the menu structure in tree format using hierachical query which will read the menu structure from the table.  Then by double clicking the leaf nodes in the Tree, i want to open the respective .frm name attached with this menu (which also stored in the table).

Is it possible to open forms dynamically like that.

deva
0
Comment
Question by:deva_kumar
[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
  • 2
  • 2
4 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 100 total points
ID: 6479048
Absolutely, I have done exactly this in an application recently. The Treeview sits inside a picture box on the MDI form and the appropriate form is pulled from the database table as required. To show a specific form in this way:

    Dim strFormName As String
    Dim frm As Form
    strFormName = "Form2"
    Set frm = Forms.Add(strFormName)
    frm.Show

This will add the form specified in the string variable to the forms collection and then show it.

0
 
LVL 1

Author Comment

by:deva_kumar
ID: 6479137
Thanks Tim,

I will check this out and let u know.

But i encounter some problem earlier in using picture box in the MDI, if i open a screen, then that screen is going behind the picture!

Am i done any mistake...this i encounter long time ago and after that i haven't tried that.  Any how i will check it out and let u know.

0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6479144
It shouldn't go behind, you are best putting the picture box directly onto the MDI form area, setting the alignment property to the left so that it shows on the left hand side, much as the favourites/history panes do in IE. The treeview then sits in here and the MDI child forms should be displayed on the right hand side. If you want to be clever, you can also create a splitter bar which will size these panes dynamically and give you an IE look to your application. This works really well and my users are pleased with the results.
0
 
LVL 1

Author Comment

by:deva_kumar
ID: 6479341
Hi Tim,
Thanks a Lot...
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

717 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