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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reload form to update msflexgrid??? 1

Status
Not open for further replies.

vbmorton

Technical User
Dec 27, 2004
44
US
Hope someone can help me out.

I have FORMA w/msflexgrid on it.
person clicks on the grid. opens up a new formB on top of FORMA ,they do whatever on that form then click close.
I unload formB, and FORMA shows up as it was behind formB.

How can i get it to be where formB closes, FormA reloads so that all changes made in formB are automatically updated and visible when FORMA reappears from behind formB.


Does this make sense??

HELPPPP..


 
Put some code in the form_activate event to re-load the data.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
ive not heard of that.. do you have some sample code.

Thanks george!
 
There really isn't any sample code.

I assume you are familiar with the Form_Load event. It's where programmers usually put code to populate data on a form. Form_Load is good for this because it happens every time the form is loaded.

Form_Activate is another event that can be used by programmers. Form_Activate differs from form_load in that form_load fires when the form is loaded. If you set focus to another form, and then back to the original, the form_load does NOT fire again because the form is already loaded. Form_activate would fire again because, well... the form is activated again. Make sense?

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
FORMB i have

Unload FORMB
Set FORMB = Nothing



FormA i have

Private Sub form_activate()

Call Form_Load

End Sub


am i way off ???
 
Looks about right. How does it work?

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
still not reloading the grid.. how do i clear the msflexgrid?

 
I don't know. I've never worked with the flex grid.

Have you tried...

msFlexGrid.Rows = 0

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
George.

Thanks for your help. i used msflexgrid.clear
and it worked. it now updates the grid when form b dissapears.

thanks for your help.. you get a much earned star!!
 
Good. I'm glad it's working for you. Just one mroe thing.

I think that when a form loads, the Form_Load event fires and then Form_activate fires.

So, by calling Form_Load from Form_Activate, you are probably loading your form twice when you first load it. And, of course, loading a form twice is not helpful for anyone. [smile]

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top