VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Printing reports from access with vb how to do that? Rate Topic: -----

#1 gulch  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 21-January 07


Dream Kudos: 0

Share |

Printing reports from access with vb

Posted 01 March 2007 - 08:53 AM

It's like the title said: how can I print a certain page from a report from Access using visual basic?

I hope it's called report, in dutch it's called like that anyways.
Thanks for any feedback.

its in vb.net btw

This post has been edited by gulch: 03 March 2007 - 06:55 AM

Was This Post Helpful? 0
  • +
  • -


#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • Icon

Reputation: 197
  • View blog
  • Posts: 13,429
  • Joined: 12-July 02


Dream Kudos: 25

Re: Printing reports from access with vb

Posted 01 March 2007 - 11:33 AM

When you say print, do you mean to actually send the page to a physical printer?
Was This Post Helpful? 0
  • +
  • -

#3 gulch  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 21-January 07


Dream Kudos: 0

Re: Printing reports from access with vb

Posted 02 March 2007 - 07:27 AM

yes, to actually print it on paper, that's the meaning

This post has been edited by gulch: 02 March 2007 - 07:27 AM

Was This Post Helpful? 0
  • +
  • -

#4 gulch  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 21-January 07


Dream Kudos: 0

Re: Printing reports from access with vb

Posted 03 March 2007 - 05:24 AM

anyone?
Was This Post Helpful? 0
  • +
  • -

#5 NickDMax  Icon User is offline

  • Can grep dead trees!
  • Icon

Reputation: 1005
  • View blog
  • Posts: 7,698
  • Joined: 18-February 07


Dream Kudos: 1250

Expert In: Java/C++

Re: Printing reports from access with vb

Posted 03 March 2007 - 05:44 AM

Well 1 you could hit the print button on the tool bar. I am assuming that you would like to do it programaticly from within VBA or from within an external application?

From inside VBA: The key is the PrintOut method of DoCmd.

DoCmd.SelectObject(ObjectType:=.acReport, ObjectName:="Employees", InDatabaseWindow:=True)
DoCmd.PrintOut(PrintRange:= acPrintAll, Copies:=2, CollateCopies:=False)



You can also print a report out from the OpenReport method.

OpenReport(ReportName:="Sales",  View:=acViewNormal)


Was This Post Helpful? 0
  • +
  • -

#6 gulch  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 21-January 07


Dream Kudos: 0

Re: Printing reports from access with vb

Posted 03 March 2007 - 06:53 AM

not in vba, but in vb.net

edit: will this code also work in .net?
and how can i select a certain page like 300 from a report which contains 600 pages? It's probably the range, but stil, to what do i have to set it?

This post has been edited by gulch: 03 March 2007 - 06:55 AM

Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users