Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

706 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

19 Experts available now in Live!

Get 1:1 Help Now