Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Global Module
Robert Stott 
    
3 years ago
I have a Audio Book data base the (10,000 records). I use a form dedicated to selecting records. The VBA code goes through the 12 combo boxes and builds the selection criteria. At the end of the code is produces a report with:

DetailsIf Me![grpPrint] = 1 Then
    If Me![grpReportType] = 1 Then

            DoCmd.OpenReport stDocName1, acPreview, , SelCrit
    End If
    If Me![grpReportType] = 2 Then
            DoCmd.OpenReport stDocName2, acPreview, , SelCrit
    End If
    If Me![grpReportType] = 3 Then
            DoCmd.OpenReport stDocName3, acPreview, , SelCrit
    End If
Else
    If Me![grpReportType] = 1 Then
            DoCmd.OpenReport stDocName1, acNormal, , SelCrit
    End If
    If Me![grpReportType] = 2 Then
                DoCmd.OpenReport stDocName2, acNormal, , SelCrit
    End If
    If Me![grpReportType] = 3 Then
            DoCmd.OpenReport stDocName3, acNormal, , SelCrit
    End If
End If


I would like to call a global module before each Do.Cmd that would give each report a specific title. I am thinking the code in the module would look something like this:

Global Module

DetailsSub GetReportTitle ()

If CboBox.ClassID= "55" then
Me.lblTitle.caption = "Fiction Detail"

ElseIf cboTitleID = "56"  then
Me.lblTitle.caption = "History Detail"

ElseIF CboBox.ClassID= "57" then
Me.lblTitle.caption = "Science Detail"

ElseIfCboBox.ClassID= "1" then
Me.lblTitle.caption = "Biographical Detail"

ElseIfCboBox.ClassID= "22" then
Me.lblTitle.caption = "Philosophy/Religion Detail"

ElseIfCboBox.ClassID= "30" then
Me.lblTitle.caption = "Language/Writing/Journalism Detail"

ElseIf cboTitleID = "35"  then
Me.lblTitel.caption = "Knowledge Base"

ElseMe.lblTitle.caption = "Detail Report"
End If

End Sub


I have little experience using Global or Private Module. I am looking for direction on this issue. I really don't want a separate report for each ClassID. Any help would be appreciated.
John Davy  @Reply  
         
3 years ago
Hi Robert
Have you thought about putting the info in 2 fields in a table and doing a Dlookup?
John

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

Next Unseen

 
New Feature: Comment Live View
 
 

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 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/2/2026 8:53:56 AM. PLT: 1s