?
Solved

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

Posted on 2001-09-13
4
Medium Priority
?
188 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 400 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

762 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