While I was scouring the Upwork gigs, one caught my eye, they left an Excel spreadsheet example and so I decide it was good enough to try and recreate it in Access database format.
I just couldn’t pass up the challenge on this one. So I figured I wanted to share the journey with you all.
First I want to find the sheet that has the source data for various worksheets in the workbook:
Here’s how I find it:
I highlighted all the sheet tabs yellow.
I found that 1 sheet has all the data for the pivot tables. This is the sheet, so I am going to create a table in Access based on this sheet:
You can create your own data table, but the easiest way to generate a table with the data, is just to import it:
After you import the Excel sheet with the data, just edit the fields. Also you need to change the name of the table (which will be imported as per the name of the worksheet)
I will change the name of the table to “tblTimeMaster” and leave the field names the same.
Now I’m going to construct a query based on the worksheet called “Hydr.VMOD” which is a pivot table.
The pivot table shows me all the fields I need for my query:
You may be asking, “why that sheet”? It was just an arbitrary sheet, and they look about the same. So if 1 works correctly then they all should work correctly. (If not, I’ll deal with it later 🙂 )
I need to find out what the pivot table is being filtered by, so I do this:
It’s being filtered by “Hydraulics” and “VMOD”, so my query is going to look like this:
Now since a pivot table in access is called a crosstab query, here is the way my crosstab query looks:
Now format the hours column to have no decimal places:
I had to add the jobcode_2 field, but here is how the result looks so far:
That looks pretty similar to the original spreadsheet, but not be can be creative and add new queries and buttons and reports and such.
Questions so far?

Learn Access VBA: Understand Tables, Queries, Forms, and Reports
Learn Access VBA: From Zero to Database Hero If you’ve ever opened Microsoft Access and wondered how all the pieces fit together — tables, queries, forms, and reports — this tutorial is made for you. In just a few minutes, you’ll understand how Access works behind the scenes and see how VBA (Visual Basic for […]
How to Fix Run Time Error 1004 in Excel
If you work with Microsoft Excel frequently, chances ar ling for a solution. Fortunately, this error is well-documented, and there are several ways to resolve it. In this article, we’ll explore the causes of run time error 1004, practical steps to fix it, and preventive measures to reduce the chances of it happening again. What […]
How To Escape Apostrophe In SQL Update Query
If you are looping a table with thousands of records, you’ll probably run into at least one that has an apostrophe in the field name. Like “Mike’s” or “M’cormick”, or something else. Anyway, here is one way to escape the string when you are doing your update query. Option Compare Database Sub YDriveLoop() ‘4/23/24 erik@loeblcomservices.com […]
How To Parse A Flat File In Excel VBA
In another post I demonstrated how to access a file on your computer using the MS Office Library. Here it is if you don’t know what I’m talking about. In this post, I am going to show you how to access the file and load it into your spreadsheet. I will do the same thing […]
Support these sponsors: