473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Macro Opens Multiple Parameter queries requiring same answer

Hello Folks

I have a Macro which consecutively opens seven ‘Make Table Query’s’. Each query requests two parameter inputs i.e. ‘Please Enter Department Code’ and ‘Please Enter Year’. It is arduous answering each parameter request for the seven queries’s as the answer to each department code will be the same department code and the answer to every year will be the same year. (I may choose to enter a different department or a different year but I would have to enter exactly the same information repeatedly as each query opens for that department and for that year). Is there a global parameter into which I can enter the year just once and the department just once?

The Macro is like this:
Setwarnings No
OpenQuery
OpenQuery
OpenQuery etc X7 querys
Msgbox “Action completed successfully”

Additional information: The data entered into the seven new tables resulting from the Make Table query’s, is linked to an excel worksheet. I simply update the worksheet to obtain the data I need about that department during that year. My problem is answering the 14 parameter questions in order to make the seven tables.

I would be very pleased to hear from anyone who knows how to resolve this. I am sure there must be some provision made, some tool which I am simply not aware of.

Thank you all for reading this and for any reply’s offered.
Feb 25 '09 #1
4 3157
NeoPa
32,556 Expert Mod 16PB
Personally, I'd junk the macro and code it up behind a form.

The form could have the two values on it (as unbound controls) and all the queries could either refer to the form controls in their design or, my personal preference, would be executed as SQL built up by the form's code using the SQL from the queries and the values on the form.

Welcome to Bytes!
Feb 25 '09 #2
NeoPa
32,556 Expert Mod 16PB
If you really don't want to junk the macro, you can still use the form and design the queries to get their info from there.
Feb 25 '09 #3
Hello NeoPa
Thank you for your reply. I do not know SQL although I do use a few little bits of code like msgbox "----- "and Docmd.Maximize. I will research on the net about how to make a query pick up readings from a form (Unbound control would be a Text Box i expect). Thank you for the suggestion. I look forward to researching how to implement this. If I really cannot resolve it after a few weeks I will return to this forum.
Many thanks for your reply and guidance.
Feb 27 '09 #4
NeoPa
32,556 Expert Mod 16PB
No worries David. We're here if you need more help.
Feb 27 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
2
by: Edgar | last post by:
I want to go from viewing a form (record number "x") to the same record ("x") in a report. Of course, when I open the report, it opens to the first record, not record "x". I don't know VBA,...
4
by: italiak | last post by:
Hello everyone- I have these 500 queries in access. They all do the same thing (append data from big database to a table) and have similar condition. I was wondering if there is a way I can...
0
by: MHenry | last post by:
Hi, I know virtually nothing about creating Macros in Access. I would appreciate some help in creating a Macro or Macros that automatically run(s) 14 Queries (three Make Table Queries, and 11...
5
by: Comcast Newsgroups | last post by:
I'm trying to put together a macro that queries my cell phone call expense DB the selects records as of a specific Date that are not marked "Archive", prints a report, then marks the records...
7
by: Newbie_sw2003 | last post by:
Where should I use them? I am giving you my understandings. Please correct me if I am wrong: MACRO: e.g.:#define ref-name 99 The code is substituted by the MACRO ref-name. So no overhead....
9
by: skinnybloke | last post by:
Hi - I have 3 access queries which I run via 1 macro. Each of the queries now requires 2 parameters when they the run. The parameters are start and end dates. I have built the parameters...
10
by: Praveen.Kumar.SP | last post by:
Hi Could anyone solve the problem for the code below The Code: #include "stdio.h" #include "iostream.h" void Temp( int a, char* str,...)
3
by: swb76 | last post by:
Hi, I have 6 queries in Access that run great. They need to be run in sequence with the first 5 queries writing to tables and the sixth one pops up the final results in datasheet view. Now, how...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.