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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Reports with Run time version of Access 3

Status
Not open for further replies.

khwaja

Technical User
Aug 27, 2001
431
AU
I created an application for users under theassumption that they would be able to print a report by either using File/Print menu or clicking the printer icon in the toolbar. However, as it transpired not all of my users hold Access license and were abvle to open the file by clicking the file itself. I don't know if I am usuing the right expression but this is referred to as run-time access to MS Access.

The issue is that in the absence of licensed Access, users are unable to print the report. I tried creating a custome toolbar with a print menu icon but that does not allow to modify print settings. As a result users are able to printy the full report and not selective pages. Could someone guide me in getting around this problem?

A similar issue I have is being unable to present a print dialogue box to user when providing a customised print icon on the data entry form. Is there some way, one can modify the underlying routine to present the print menu.

Regards

AK
 
What you are experiencing is a limitation of the RunTime version of Access. You the programmer must make interfaces for the user to print, as MS took all of it out for that version. It's probably easier to bite the bullet and buy another couple copies of Access, but there are some routines that you could find in either the Access VBA forum or in the Access General forum here at Tek-Tips.

HTH Joe Miller
joe.miller@flotech.net
 
Thanks Joe. Mine is a very large orgainsation with nearly 130,000 employees and quite a lot of these have geographicale spread. Buying extra version of MS Acess for users is decided by Corporate IT. Anyway, I hope to be able to receive more responses in this forum. I am not very advanced user of Access and have little knowledge of VB.


Regards

AK
 
The easiest solution of your problem might be to integrate two print buttons on your form:
1.) Display on screen: Docmd.openreport "RepName",A_Preview...
2.) Send to printer : Docmd.openreport "RepName",A_Normal...
 
Sorry Joe, it is a report not a form. Can we still use this solution?

Thanks.
 
Sorry to raise this question again. Is there some way, I can have a command buttons in the tool bar on report print preview screen to print report currently on screen? If there has to be an underlying code, could you please help me with that too?

Cheers
 
AK,

I found your post while searching the net for an answer to exactly the same problem that you have.
The closest solution that I've figured out so far is to create a macro as follows:

Action: DoMenuItem
Menu Bar: Form
Menu Name: File
Command: Print

You can then call the macro from a toolbar button, and it will display the print dialog, allowing the user to select the print range, etc.

The main problem that I've found is that the toolbar option is always available (i.e. I've not figured out a way of only showing it when a report is being previewed).

I hope that it is of some help, though.

Jon K.
 
Much appreciate your help. I almost gave up on this.

Regards
 
How many of your users utilize Microsoft Outlook, or even Adobe Acrobat?

You could have Access generate the report in an RTF format, and then e-mail it to the user via Outlook, or save the file to the hard drive in a PDF format. The user could then print off the file in the format that suits them best.

HTH

Greg Tammi, ATS Alarm Supervisor
 
Greg

Almost all users have access to MS Outlook. But none of them have the Adobe writer license. Under the circumstances, I think RTF option might be better. How do I configure this?

Cheers

AK
 
AK:

2 things...first, create the follow function in your database - I usually save this as it's own separate module:

Code:
 Function SendMail(strTo As String, strRepName As String)

   DoCmd.SendObject acSendReport, strRepName, acFormatRTF, strTo, , , , , False

End Function

Now that this function is created, you will need to add the following 2 objects to your database:

a) a table called tblReports that contains the names of all
the reports in your database (note: this is a single column table)
b) a form with the following controls (rename them if you like, these are the naming conventions that I prefer):

Text Box: Name = txtSendTo
Text Box Label: Caption = "Enter your E-mail address here:"

Combo Box: Name = cmbReports
RowSourceType = Table / Query
RowSource = tblReports
Column Count = 1
Default Value = "Select Report"

Command Button: Name = cmdSendMail
Caption = "Send Report"
On Click = [Event Procedure]

Ok, now we have the following 3 things created: a table of report names called tblReports, a function that will send the report in RTF format, and a form used to get the user's e-mail address and the name of the report they want. The last thing needed is to write the 'On Click' event procedure to call the function and send the report...
Code:
Private Sub cmdSendMail_Click()

'let's do some error checking first, shall we?
Code:
   If IsNull(txtSendTo) Then
      MsgBox "Please enter an e-mail address before continuing.", vbInformation, "No E-mail Address Detected"
      Exit Sub
   Else If cmbReports = "Send Report" Then
      MsgBox "Please select a report before continuing.", vbInformation, "No Report Selected"
      Exit Sub
   End If

'Ok - user has entered an e-mail address and has selected a report - let's call the SendMail function and pass it the e-mail address and the report name
Code:
   SendMail txtSendTo, cmbReports.Column(0)

End Sub

Hope this helps AK; if you require further assistance or need clarification, I can be reached at the e-mail address below or by responding to this post.

Greg Tammi, ATS Alarm Supervisor
E-mail: gtammi@atsbell.com



 
Greg, you are anazing. Well done. Can't thank you enough. I am sure it would work fine but if not I willbe in touch.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top