Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

Variables won't print to printer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sky Warren - 07 Apr 2005 21:31 GMT
Hello all,

How can I get variables passed to a report from a form to print on my printer?

I have a unbound text box in my report 's Page Header section that displays
custom text depending on values selected from my form. Everything works as
expected while viewing in the report window. If I print the report everything
prints except the values passed from the form.

The unbound text box is named "txtCustomer" that's in the Report Header
section. In the Report Headers "On Format" event I have the following
procedure:

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
Dim headText As String

headText = "Product Type Listing for "

Me.txtCustomer = headText & Forms![Application Form]!ProductType.Value
End Sub

-Sky
Albert D. Kallal - 07 Apr 2005 21:47 GMT
Hum, if it displays while previewing the report..and then you go file->print
(while STILL viewing the report)...it should work.

Perhaps you accident set the text box to not visible?

Perhaps the text box needs to be enlarged. Try making the text box MUCH
wider....(just for testing).

Perhaps the font is a color..and you inkjet colors (except for black) have
run out??

Do you have a pdf printer....can  you print to that...and see what happens?

Signature

Albert D. Kallal   (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.members.shaw.ca/AlbertKallal

Sky Warren - 07 Apr 2005 23:15 GMT
Hi Al,

I traced the problem back to the code for the Combo Box where selections are
made. The line that says " Me.ProductType = Null " caused the printing
problem. Once I removed that line, everything prints correctly including any
variable data passed from the form.

Here's the code in question:

Private Sub ProductType_AfterUpdate()
DoCmd.OpenReport "Product Type", acViewPreview
DoCmd.Maximize
RunCommand acCmdFitToWindow
Me.ProductType = Null
End Sub

Thanks Al for your time. I feel silly not figuring this out sooner :-(

-Sky

> Hum, if it displays while previewing the report..and then you go file->print
> (while STILL viewing the report)...it should work.
[quoted text clipped - 8 lines]
>
> Do you have a pdf printer....can  you print to that...and see what happens?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.