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 
Excel cant see Queries in Pivot Table
Bruce R 
    
14 years ago
As many of you know, you can't build range names (whether they are one cell, or a range of cells) in Access. You can, however, construct global variables. One of the global variables I made to account for the number of billable hours in one year is as follows:

Option Compare Database
Option Explicit

Public Const HoursYear As Integer = 1824

Function GetAnnHrs()

    GetAnnHrs = HoursYear
    
End Function

I can then use this in a query by multiplying one of the fields of a table by the function GetAnnHrs(), and the result in the expression shows that if there is $100 per hour in the rate field, the expression will calculate $100 times 1,824, or $182,400. This works perfectly well in Access, however, if I want to go into Excel and create a pivot table with an Access query being the source, Excel doesn't "see" the query. I have to go into the database and replace the function GetAnnHrs() with 1824. When I do this, Excel will then "see" the query when I want to build a pivot table in Excel.

What do I have to do in Excel so that I can continue to use the global variable in Access? Also, are there any other approaches in Access that are simpler that constructing global variables?

Thank you,
Bruce


Reply from Richard Rost:

I'm not exactly sure what you're trying to do, but instead of using a query and then basing your Excel PivotTable on that query, why not use a MAKE-TABLE QUERY to construct a TABLE in Access, and then use THAT in Excel?

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/16/2026 10:56:23 PM. PLT: 0s