Solved

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

Posted on 2001-09-13
4
182 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

832 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