Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Same form loading twice. 1

Status
Not open for further replies.

ind123p

Programmer
Sep 28, 2005
62
I am using VB6.

I have a MDI parent )mdiMain) and two MDI Child forms. ( FOrm1 and Form2)

When the application opens the Form 1 (transacation entry) opens in the MDI parent screen.

I click on the menu to open Form 2 ( form 1 is still open). Form2 is History form displaying transactions entered. From Form 2 I wish to open the same Form1 for editing the transactions. But instead it is creating a new instance of Form1. So there are two versions of the FORM 1

How do I set focus on the form 1 that is already open and visible ? I do not want FORM 1 to be created again.

I will appreciate any help in this regard.
 
Which is as it should be.

However, if I understand what you are trying to, All you really need to do is make form1 the active form

It has been a couple of years since I had to do this, however, MSDN had a good explanation of MIDI forms and covers this

Look up the syntax in HELP

If you have trouble with the syntax, let me know.
The company I am working for does not have MSDN installed and my personal laptop is at home so it would have to be over the weekend



 
>How do I set focus on the form 1

You're gonna hate this....

[tt]Form1.SetFocus[/tt]

is how to do it! :)
 
I think I will just slink away hanging my head :(
I confused myself. In my old code I had to determine which open form was active. I forgot what I had developed

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top