Hello again:
I am doing a parameter query of an Access table that we can call Master. At an unpredictable time during each month, a monthly table, called mmmyyModComp, is deposited in the Access. I need to be able to detect when it is there and have it appended to the Master table before I issue the parameter query. I could accomplish the same thing with a union query using Msquery but the EXCEL97 version will not allow the use of parameters with a Union query. So, I would need to be able to save the result of the union query and then run the parameter query against it. I do not know how to do this using MSQUERY or DAO. Can any one give me a clue?
Currently, I am manually appending the monthly table to the Master in ACCESS. I would like to be able to get out of the loop and completely hand over the programs to the people who want to use them.
Thanks
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Appending Access tables prior to a parameterQuery (OFFICE 97 SR2)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Appending Access tables prior to a parameterQuery (OFFICE 97 SR2)
- This topic has 5 replies, 4 voices, and was last updated 23 years, 3 months ago.
AuthorTopicWSepic60sman
AskWoody LoungerMarch 6, 2002 at 9:05 pm #367841Viewing 0 reply threadsAuthorReplies-
WSralphad
AskWoody LoungerMarch 7, 2002 at 9:00 am #574871How is this access database used? Do you have a client application which you built which is the sole entry point, or are there other ways that people use the data? If the former, you could build something into your application which looks for the mmmyyModComp table when it initialises, then appends the table’s data to Master, before deleting the mmmyyModComp table or renaming it for archiving. If there are other ways that people use the data, then I’d say you need an application running somewhere which polls the database for the appearance of the file, and then does the appending, etc. This kind of application would have to be running on a server somewhere, if you have access to such resources.
Regards,
-
WSepic60sman
AskWoody LoungerMarch 7, 2002 at 2:53 pm #574915You asked: “Do you have a client application which you built which is the sole entry point”. Answer: YES
You commented: “you could build something into your application which looks for the mmmyyModComp table when it initialises, then appends the table’s data to Master, before deleting the mmmyyModComp table or renaming it for archiving.”
Yes, this is exactly what I need.
My idea was to use a union query to append the 2 tables. However, my application consists of a parameter query that is launched out of EXCEL97 and MSQUERY (or DAO) will not allow use of parameters with a union query. My next idea was to use the union query to append the tables and the parameter query to get the data from the appended table but I do not know how to do this. I tried saving the EXCEL query and then using the parameter query to get data from it but found that this was not possible. Is there some way that the EXCEL query can save the appended table in ACCESS?
Basically, I understand what I need to do but I don’t know how to do it.
Thanks for your help -
WSrory
AskWoody LoungerMarch 7, 2002 at 5:21 pm #574957Hi,
You can certainly do this with DAO. You would code your Excel spreadsheet to open the database, check the Tabledefs collection for the relevant tablename, if there, run an append query. You then have the option of either using your existing Excel query or simply opening a recordset since you have the database open anyway. Then you need to delete the table and close the database.
You could equally run the whole thing from Access, automating Excel and copying the relevant recordset into it. Just depends on whether your users are comfortable using Access or want to do it all through Excel!
Hope that helps. -
WSdcardno
AskWoody LoungerMarch 7, 2002 at 11:17 pm #575013The other alternative is to design a union query in Access that does the union you want, then a make-table query in Access that just takes the union query you just wrote in the query grid and the “*” for all fields and creates a new table – call this table “NewTable” and the query qryMkNewTable. You have to do this two-step approach since you can’t write a “Union Make Table” query (or maybe YOU can – I can’t ).
In Excel you open the querydefs collection and execute qryMkNewTable, and then run the parameter query against NewTable
-
WSralphad
AskWoody LoungerMarch 12, 2002 at 8:36 pm #575887I’d say your excel sheet should stay just as it is, for simplicity, with just the addition of a bit if VBA in an AutoOpen() routine, which uses DAO, as Rory suggests, to run the append query which will append the contents of mmmyyModComp to the Master table.
Something like this should do the trick, placed in a module in your Workbook (the Workbook will have to be referenced to DAO – please ask if you don’t know how to do this):-
Sub AutoOpen() Dim db As Database Dim tbl As TableDef Dim sTablename As String 'open the database Set db = OpenDatabase("c:mydatabase.mdb") 'loop thru the tabledefs to see if this month's table is there sTablename = Format(Date, "mmmyy") & "ModComp" For Each tbl In db.TableDefs If tbl.Name = sTablename Then 'rename the monthly table to the name that the append query is looking for db.TableDefs(sTablename).Name = "ModComp" 'run the append query db.QueryDefs("myAppendQuery").Execute 'rename the table back to the monthly name, _ with a suffix indicating it has been appended to Master db.TableDefs("ModComp").Name = sTablename & "_appended" 'exit the loop thru the tables Exit For End If Next tbl 'close the database db.Close 'garbage collection Set tbl = Nothing Set db = Nothing End Sub
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
1 hour, 42 minutes ago -
National scam day
by
Susan Bradley
3 hours, 3 minutes ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
17 hours ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
18 hours, 20 minutes ago -
Tools to support internet discussions
by
Kathy Stevens
1 day, 1 hour ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
9 hours, 26 minutes ago -
AI is good sometimes
by
Susan Bradley
1 day, 1 hour ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
15 hours, 35 minutes ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
2 days, 1 hour ago -
June KB5060842 update broke DHCP server service
by
Alex5723
2 days ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
2 days, 4 hours ago -
Excessive security alerts
by
WSSebastian42
19 hours, 12 minutes ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
2 days, 13 hours ago -
Ben’s excellent adventure with Linux
by
Ben Myers
7 hours ago -
Seconds are back in Windows 10!
by
Susan Bradley
2 days, 1 hour ago -
WebBrowserPassView — Take inventory of your stored passwords
by
Deanna McElveen
18 hours, 38 minutes ago -
OS news from WWDC 2025
by
Will Fastie
4 hours, 44 minutes ago -
Need help with graphics…
by
WSBatBytes
1 day, 9 hours ago -
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
3 days, 5 hours ago -
Totally remove or disable BitLocker
by
CWBillow
2 days, 4 hours ago -
Windows 10 gets 6 years of ESU?
by
n0ads
2 days, 7 hours ago -
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
3 days, 16 hours ago -
Search Forums only bring up my posts?
by
Deo
1 day ago -
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
4 days, 3 hours ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
7 hours, 58 minutes ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
58 minutes ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
4 days, 14 hours ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
4 days, 15 hours ago -
Disengage Bitlocker
by
CWBillow
4 days, 5 hours ago -
Mac Mini M2 Service Program for No Power Issue
by
Alex5723
4 days, 17 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.