473,657 Members | 2,612 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Macro Opens Multiple Parameter queries requiring same answer

11 New Member
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 3173
NeoPa
32,568 Recognized Expert Moderator MVP
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,568 Recognized Expert Moderator MVP
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
David Wright
11 New Member
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,568 Recognized Expert Moderator MVP
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
33863
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 capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it could be possible to add Pythonistic syntax to Lisp or Scheme, while keeping all of the...
2
3392
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, only macros. Is there any way to do this with macros (I tried time stamping a field in the form when I enter a record and then using a query to sort by max date as
4
9828
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 create a macro to modify the content of these queries. If the modify macro is not possible then I can delete the queries and try to create a macro which can create queries from scratch. Any help is appreciated.
0
8770
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 Append Queries) when the Database is first opened, and then again anytime I invoke the Macro (somehow) after the database is already open. The latter function is useful, because the queries must be rerun every time data is added, deleted, or...
5
2000
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 "Archive". I've worked out the Queries and the report and even got them into the macro but I can't figure out how to set up the Macro to prompt for ONE Date. Instead I get a prompt for the Select Query date and then again for the Update Query date. ...
7
23540
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. Execution is faster. Where will it be stotred?(Is it in bss/stack/?) FUNCTION:
9
35445
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 into the queries but on running the macro I have to enter each of the dates 3 times - once for each query. Is there an easy way to ask for the parameters once and for these to be passed onto each query?
10
9836
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
16212
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 can i automate this process? I started with the simple macro builder and entered all 6 queries perfectly fine. However, i want to prompt the user if they wish to run queries 1 & 2, if they say no, it should move to 3 and run the remaining ones....
0
8730
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7321
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1950
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1607
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.