Adrian Adrian - 2 years ago 68 Question

How to open a frmWindow a second time wothout refreshing a grid in the first one?

I have a Window with a Grid that is making a select from MySQL, and using the

function insted of
I can open the same window a second time to have two instances of the same window.

Now, when i open the second instance the grid populates with the new selection also in the first window. How can I make the window to open the second time without refresing the grid in it again in the first one?

Answer Source

If you are creating a new instance of the same form, based on the variable "myForm" from different locations, you are in effect going to "refresh" both forms.

One way to get around this is to create a second variable instance of your frmMain in a seperate function. (ie... not good at VB at all, so forgive my VB programming skills.)

In one function:

Dim myForm AS New formMain()

In a second function

Dim frmTwo AS New frmMain()

Then you just make your calls to frmTwo, which is the second form opened.

I hope this helps.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download