By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,455 Members | 2,306 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,455 IT Pros & Developers. It's quick & easy.

How to generate a report from Access to a file they can either save or print?

P: 26
I have the following code that works fine when I run it locally, but when trying to run the report from Access through the Citrix server, I get MS VB Run-time error 2501: The OutputTo action was canceled. My particular My Documents folder is mapped to the N: drive. Any help will be greatly appreciated. Thank you.
Expand|Select|Wrap|Line Numbers
  1. Private Sub MyAuditStatus_Click()
  2.  
  3.     Dim dbscw As DAO.Database
  4.     Dim rstcw As DAO.Recordset
  5.  
  6.     AdataLoc = "N:\My Documents"
  7.  
  8. 'check if manager has direct reports
  9.     strSQL = "SELECT Count(*) AS NBR_DIRECT_REPORTS FROM TEMP_DIRECT_RPTS WHERE MGR_LAN_ID='" & Me.MANAGER.Value & "'"
  10.  
  11.  
  12.     Set dbs = CurrentDb()
  13.     Set rst = dbs.OpenRecordset(strSQL)
  14.   'if manager has direct reports, run compliance report.
  15.     If rst![NBR_DIRECT_REPORTS] > 0 Then
  16.         rst.Close
  17.         dbs.Close
  18.  
  19.         DoCmd.OutputTo acOutputReport, "rpt_MyAuditStatus", "PDF Format (*.pdf)", AdataLoc & "\MAAR-MyAuditStatus.pdf", True, , , acExportQualityPrint
  20.         Else
  21.         MsgBox ("You don't have any direct reports.  If you feel this is an error please call MTS Service Center")
  22.         rst.Close
  23.         dbs.Close
  24.     End If
  25.  
  26. End Sub
  27.  
Mar 1 '12 #1
Share this Question
Share on Google+
10 Replies


100+
P: 759
From what I see in your code, you dimension dbscw and rstcw variables (lines #3 and #4) but set dbs and rst (lines #12 and #13).

I think that you make an error when you post this because, unless if you not use Option Explicit, your compiler must raise an error.

Anyway fix that first.
Mar 2 '12 #2

P: 26
Hello Mihail,
Fixed that part. The code creates the report for me locally, but when I create the accde and try to run it through Citrix, now I get a different error: "Your Microsoft Access database or project contains a missing or broken reference to the file 'Wfica.ocx' version 2.8." I will work on that and see if I can fix that now. I think my biggest question now is how to deploy the application so that it can function through Citrix. Thank you for your help.
Mar 2 '12 #3

TheSmileyCoder
Expert Mod 100+
P: 2,321
I will admit that I am not too familiar with citrix, so bear that in mind when you read my thoughts.

Are you accesssing a remote desktop? In that case the remote desktop needs to be setup with the correct dlls, and have the network share mapped to the same drive as your example.
Mar 2 '12 #4

100+
P: 759
While Smiley is not "too familiar with citrix", I never herd about.
So I can't help you anymore in this direction.

But I can provide you a very big help by repeating that:
Always use Option Explicit in your projects !.
If you do so, you will avoid a lot of troubles in the future.

In the VBA editor go to Tools -> Options and, under Editor tab, check Require Variable Declaration.

This will become effective for new modules you will create.
For the oldest module you can type, at the top of module, this statement:
Expand|Select|Wrap|Line Numbers
  1. Option Explicit
Mar 2 '12 #5

P: 26
Okay, thanks for the tip!
Mar 2 '12 #6

TheSmileyCoder
Expert Mod 100+
P: 2,321
A quick google tells me that Wfica.ocx is used by Citrix. However I dont see any reason for a normal Access database to require a reference to that. Have you tried simply removing it?
Mar 2 '12 #7

P: 26
I ended up recompiling the database and publishing a new accde and then the error was gone. Thankfully!!
Mar 2 '12 #8

Rabbit
Expert Mod 10K+
P: 12,315
Citrix has a lot of products. Which one are you talking about?
Mar 2 '12 #9

P: 26
Citrix online plug-in (PNA), and it is saved on my computer in a folder called ICA Client. Does that answer your question? Let me know. Thank you.
Mar 5 '12 #10

Rabbit
Expert Mod 10K+
P: 12,315
That's the plugin for Citrix XenApp. XenApp is a virtualization software and it is unlikely to be configured the same as your local work computer. Specifically I mean that your N drive (which I assume is a network share of some sort) is unlikely to be mapped on the virtual server.
Mar 5 '12 #11

Post your reply

Sign in to post your reply or Sign up for a free account.