Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MDE Report Printing

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
I thought this problem would go away. I have an application that I pass to someone as an mde version. On the form I have 2 buttons, 1 to preview a report, the other to print it.

I ended up doing it with 2 buttons as I could not get a preview/print version, ie having a menu on the preview page having a print button. I had so many problems understanding the way a custom menu was built. However the user now wants it this way, ie open preview and have a button to print the report from preview.

Can someone run through the process of doing it.

Present button codes are:

To preview only:
DoCmd.OpenReport "AthleteShotKeywords", acViewPreview

To print:
DoCmd.OpenReport "AthleteShotKeywords", acViewPreview
RunCommand acCmdPrint

The underlying form stays open and is below the preview/print pages. Thanks
 
Create a custom toolbar.

Add the print button to the toolbar - plus any more that you need.

Assign the toolbar to the report, it will come up.

You can then have the user click the toolbar button (or press Ctrl P) to print the report.

John
 
Thanks. I went into Tools/Customise and made a new custom menu called Reporting. I added the print report button, and an exit button.

I opened up a report, and in the properties box Toolbar I selected Reporting. When I ran the report, there was no Reporting menubar.

I went back into the tools, customise, found Reporting and it was unchecked. Tried the report again and no change.

I know in the past my attempts came unstuck when I got near to what was wanted by a dialogue box appearing saying I could not modify a report with an MDE version.

I have this code in my report:

Option Compare Database

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.Section(0).BackColor = vbWhite Then
Me.Section(0).BackColor = 15724527 'gray
Else
Me.Section(0).BackColor = vbWhite
End If
End Sub

Private Sub Report_Activate()
DoCmd.Maximize
End Sub

Private Sub Report_Page()
Exit Sub

On Error Resume Next

Me.DrawWidth = 5
Me.DrawStyle = 0

Me.Line (0, 0)-(Me.ScaleWidth - 500, Me.ScaleHeight - 150), vbBlack, B

End Sub

Private Sub Report_Open(Cancel As Integer)
DoCmd.Maximize
Me.RecordSource = Forms!AthleteCompetition!
LP1.RowSource
Me.AthleteName.Caption = UCase(strGlobal2)
Me.SportName.Caption = UCase(strGlobal3)
Me.CompetitionName.Caption = UCase(strGlobal4)
End Sub

Maybe it's because I have the report opeing in maximised state?, however I need this to keep unwanted fingers on any other menus that might be at the top. Any ideas, thanks
 
might be your report opens as modal/popup =true
reset it or try to create a shortcut menu for report.

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Thanks Zameer, good to hear from you. Yes the reports have modal=yes and popup=yes. I had so many problems with the reports piling under the mainform out of site, users possibly minimising the reports. My application forms cover everything a user needs to keep unwanted fingers away. Regards
 
Howdy ZOR . . .

Are you saying the default [blue]Print Preview[/blue] toolbar (not menubar) is insufficient?

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
Only possible way I have seen in this situation is to create your own shortcut menu for the report.

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Thanks all. I am going to tell the user it cannot be done. My Print Preview button and Print Report buttons work perfectly, both modes fully cover the screen to the top and appear over the database mainform. They are just too lazy to close the preview mode and select print. System/Custom toolbars do not show. Regards
 
little amendment
Code:
To preview only:
DoCmd.OpenReport "AthleteShotKeywords", acViewPreview

To print directly to printer.
DoCmd.OpenReport "AthleteShotKeywords", [b]acViewNormal[/b]

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Thanks Zameer, I used acViewPreview in the print function so that the user had a last look on screen while printing.
However thanks again.
 
ZmrAbdulla . . .

I have a number of Db's out there that have, or have had, the problem your indicating here. The question is:

Are you trying to make these changes in the MDE directly or what?



Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
The Aceman1,
Not sure you are talking to me.. because the OP is ZOR.

My reply was Reports opened MODAL=TRUE & POPUP=TRUE are missing all the toolbars for some reason. I wasn't able to get them back keeping the report MODAL=TRUE & POPUP=TRUE.

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
ZmrAbdulla . . .

Yes . . . my post was meant for [blue]ZOR![/blue] Sorry about that . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
Thanks. Until I started using the code first posted, my code ran okay, but as soon as I converted the application into an mde version I got errors which led to finding the report could not be modified in an mde version. I have code on the report open event which failed each time. It would be good if I could put a button in the report header which was active in preview allowing the report to be printed, but that's impossible. As my report forms open and fully cover the screen, any toolbars at the top are obscured. I have told my user he cannot have anything else other than 2 buttons on his form, 1 to Preview and 1 to Print. He's accepted it. Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top