Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Disable Printing < Who Had Item 2 | Disable Printing 2 >
Back to Disable Printing    Comments List
Upload Images   Link   Email  
What If I
Jeffrey Kraft 
      
9 months ago
I'm horrible with Global module writing - or at least not that good.

So I ask Lord Richard King of Access.

I have many reports (many is more reports than I have fingers and toes.  Is their a way to not have to rewrite.  I tried to turn it into a Global Module Sub and the it sunk loke most of my Global Module Sub and/Function attempts (probably because I don't do them very often.)  I got a Argument not optional in the compile and retreated back to the example you used.
Richard Rost 
            
9 months ago
I'm completely lost. Start from the beginning and explain to me what you're trying to do in concept.
Jeffrey Kraft OP 
      
9 months ago
As I said I have love/hate relationship with Global Modules.

The idea was like Lorenzo's where I don't want the user to press P or Ctrl P to print but rather use a button, either for  a list of reports and code within would let me know that they were printed afterwards.  But I didn't want to enter those 5 lines of code with each report.  One line would be enough

And as Dumb luck happens (again), I solved my issue, only after dropping it on this door mat.  The Global Module Public Sub is named HandleKeyDown and on the Report all I typed in the On KeyDown on the report was HandleKeyDown, instead of Call HandleKeyDown.

So I apologize to Lord Ricard King of Access for spending time reading my post.
Sami Shamma 
              
9 months ago
Spelling, spelling, spelling
This is what Lord Richard King of access always tell us his faithful subjects.
Jeffrey Kraft OP 
      
9 months ago
Except the issue wasn't spelling it was forgetting to put the word Call

Here is the Global part

Public Sub HandleKeyDown(KeyCode As Integer, Shift As Integer)
    ' This subroutine will be called when the P key is pressed down
    
    If KeyCode = 80 And Shift = 2 Then
        MsgBox "Ctrl - P was pressed, please use Print Button", vbInformation, _
        "Warning"
        KeyCode = 0
    End If
    
End Sub

On the report

Private Sub Report_KeyDown(KeyCode As Integer, Shift As Integer)

    Call HandleKeyDown([KeyCode], [Shift])
    
End Sub

I missed the word Call in that line, which was really stupid because I did a Global earlier and remembered to Call.  So many things to remember and one more thing to forget.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Disable Printing.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 12/14/2024 7:16:12 AM. PLT: 1s