vb123.com

Garry Robinson's Popular MS Access, Office and VB Resource Site

 

Home  Contact Us
Order our Software

RSS & Newsletter  
Join our XML/RSS Newsfeed or sign up for our informative newsletter on Office Automation, Access and VB topics
Read More

Get Good Help
If you need help with a database, our Professionals could be the answer
Read More

  Is Your Database Corrupt ?
If you have a corrupt database, Try our Access Recovery service

The Workbench  Find out who has your database open, start the correct version of Access, easy compacting and backups, change startup options, mde compile,  shutdown database Read and Download

The Toolshed 
Searchable help file comprising of all the information at vb123.com plus hidden downloads etc. Read More



The Toolbox

Libraries of software that we regularly import into our projects. Enhances the Toolshed More..


DryToast New
Backup and query your BaseCamp
® projects
Read More


Datamining/Graphs

Explore your data with this versatile graphing and data mining shareware tool. 
Read More

Garry's Blog
Find out a few other things that Garry has been writing about Microsoft Access. Read more

About The Editor Garry Robinson writes for a number of popular computer magazines, is now a book author and has worked on 100+ Access databases. He is based in Sydney, Australia
Contact Us ...

Search ...

or try our Aussie
 vb123.com.au
  mirror site

 

Next Tip  Printing the MSGraph Form         Lesson 5

We are finally getting to the point where the graph form is starting to be useful.   But we need to print it out.  To the form I have now added added a print button with the following code.  The important method here is PrintForm.   This will only be suitable if the form is not cluttered with other objects as printform literally prints the form AS IS.

Private Sub PrintIt_Click()

On Error GoTo ErrorHandler

' First turn of all the controls that do not have a Tag property of Print

  Call PrintVisibility(False)

' Now print the objects that are still visible
  PrintForm

' And then turn all the other objects on again
  Call PrintVisibility(True)

Exit Sub
ErrorHandler:
 
  MsgBox "The form can't be printed."
  Resume Next
End Sub

The little trick that I used here was to hide all the objects in the form that do not have a tag property of Print.  When the form has been printed, turn them all back on again with the same form.  Add the Tag property manually by opening each object that should be printed and typing in Print in the tag field.

Private Sub PrintVisibility(visState As Boolean)
   Dim i As Integer

'  First turn off the other controls

  For i = 0 To Me.Count - 1
    If Me(i).Tag <> "Print" Then
      Me(i).Visible = visState
    End If
  Next

End Sub

That's it for controlling the MS Graph Object.

Hope you gained something useful from it  !!!

Garry Robinson

  Click here for the download file if you own "The Toolshed"  Else click here 

      Click Toolshed Help Here for help

 

 

Links >>>  Home | Search | Workbench | Orders | Newsletter | Access Security | Access professionals