Welcome to Windows Help!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

you don't have the license required to use htis activex co..

 
   Windows Help (Home) -> Microsoft Access RSS
Next:  Problem: Icon on desktop when CD or DVDRW has dis..  
Author Message
icccapital

External


Since: Jan 23, 2009
Posts: 2



(Msg. 1) Posted: Fri Jan 23, 2009 10:49 am
Post subject: you don't have the license required to use htis activex control
Archived from groups: microsoft>public>access (more info?)

I am using Access 2007 and wanted to add the microsoft common dialog control
to a form so I could have a print dialog box pop up when my print button is
clicked. Couple of questions:

1)Can I get the print dialog to show up using vba in a different way?
2)How do I fix this error?

Either or both questions are welcome. Thank you.

 >> Stay informed about: you don't have the license required to use htis activex co.. 
Back to top
Login to vote
Clifford Bass

External


Since: Dec 17, 2008
Posts: 18



(Msg. 2) Posted: Fri Jan 23, 2009 1:52 pm
Post subject: RE: you don't have the license required to use htis activex control
Archived from groups: per prev. post (more info?)

Hi,

Yes to #1. Here is how: In a regular module; not a class, form or
report module; add this subroutine:

Public Sub PrintAReportShowingPrintDialog(ByVal strReportName As String)

On Error GoTo Handle_Error

DoCmd.OpenReport strReportName, acViewPreview
DoCmd.RunCommand acCmdPrint

Exit_Sub:
On Error Resume Next

DoCmd.Close acReport, strReportName, acSaveNo

Exit Sub

Handle_Error:
If Err.Number <> 2501 Then
' 2501 occurs when user cancels the print dialog box
MsgBox "Error #" & Err.Number & ": " & Err.Description
End If
Resume Exit_Sub

End Sub

Then in your button's On Click event use something like this:

PrintAReportShowingPrintDialog "rptMy Report's Name"

It can be called from anywhere so if you want to do the same elsewhere,
you only need to call it as shown above in each of those places. Essentially
the subroutine opens the report, mimics the user choosing Print from the menu
and then closes the report. It needs to have the error handling that you see
in it so as to catch when the user cancels the print dialog. If your
report's query prompts for parameters, you will want to test out what happens
when the parameter dialog is cancelled. If it returns with a different error
number and message you can filter out that error number in the Handle_Error
part of the code.

Clifford Bass

"icccapital" wrote:

> I am using Access 2007 and wanted to add the microsoft common dialog control
> to a form so I could have a print dialog box pop up when my print button is
> clicked. Couple of questions:
>
> 1)Can I get the print dialog to show up using vba in a different way?
> 2)How do I fix this error?
>
> Either or both questions are welcome. Thank you.

 >> Stay informed about: you don't have the license required to use htis activex co.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
check box with required fields - Hello Group I need help. On a form, I created a check box named approval. “approval” can only be checked if the following fields are not blank: ProposalAmount, AwardDate, win%. If one of them or all are blank, a pop up message will display asking....

Microsoft Office - Can you update Microsoft office version 2003 to 2007 or do you have to buy the newer version

From access to word - Print - Hello, We open word letter from access with hiperlink code. . . .. . . Application.FollowHyperlink "h:\DRISHOT\" & lettername & ".doc" Is it possible to print the letter instead of open it ? How ? thank you

the setting for this property is too long - Hello. I was running the Access performance option and for some forms and reports there was a message with this: the setting for this property is too long what is this? what should I fix in order to not receive this error. Regards, Marco

Me.Name results in "Invalid procedure call or argument" - I am debugging an Access application written by someone else. In Access 2003 it behaves OK, but the client needs to upgrade to Access 2007 for various reasons. When the app is run in Access 2007 I get a few niggles that I have been working through, but..
   Windows Help (Home) -> Microsoft Access All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]