Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

911 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now