Print working - but making MSFlexGrid disappear when pressed! HELP!

VBKid04
04-14-2004, 09:38 PM
When I press print, my MSFlexgrid disappears. No matter how many refreshes I do it will not reappear on the form.

Only if I close the form and open it again can I see the grid again.

My code for Print is simple, but I dont want any more hassle with it (ie. Big long pieces of code):


cmdPrint_Click()

Dim old_width as Integer
MSFlexGrid_Name.width=printer.width 'makes it full length of page

Printer.PaintPicture MSFlexGrid_Name.Picture, 0, 0
Printer.EndDoc

MSFlexGrid_Name.width=old_width ' this makes it full width of the page

End Sub



If someone could just guide me in the right direction as to why the grid is disappearing or what I have to do to make it reappear.

I have even created a form refresh function, and tried to call it after the print command, but that has not worked either.


Please can someone help?

Ales Zigon
04-15-2004, 03:48 AM
in this line MSFlexGrid_Name.width=old_width ' this makes it full width of the page you're setting the width of the grid to the value of the "old_width" variable which is 0 (zero) by default - you're not setting it anywhere!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum