vb123.com

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

 

Home  Contact Us

Order Software

Search vb123

 Smart Access  
The Magazine that Access Developers loved to read and write for is back
Article Index Here or
Purchase Here

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

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

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


Access > SqlServer 
Upsize to SQL Server 2005 or 2008, easily repeated conversions, highly accurate SQL query
translation and web form conversion.
Read More

Like FMS Products?
Purchase them from us and get a free Workbench or Smart Access  More

The Toolbox
Libraries of software that we regularly import into our projects.  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 ...

 

or try our new site built with SharePoint Designer
 vb123.com.au
 

 

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