Solved

Changing Multiple Query Criteria.

Posted on 2004-04-01
2
261 Views
Last Modified: 2008-03-06
Hi,

I have an access database that contains the linked tables.  All the tables have the same specifications - they contain standard accounting information for several companies.

My database performs analysis of the information from these linked tables by extracting data for one quarter year at a time.  Therefore I have built up a series of append and delete queries, which have all been put into Macros.  When the user presses a button the data is all deleted and refreshed.  However at present each individual append query need it's criteria updated so that only the relevant quartey year's data is extracted from the tables.

I want to create a button which when clicked asks the user the enter ( once ) the quarter year he's interested in.  All the append queries shoudl then be run according to that criteria without manually having to update each and every one separatey.  I guess the criteria needs to refer to a dialog box form which runs when the user  clicks the button and then the macro needs to be run making sure that it "remembers" that the user has choosen the quarter-year criteria.

Can someone advise please - sorry to be so long- winded, but I'm nervous about playing around with my database now that i've got it to work.

Thanks,

Andrew
0
Comment
Question by:AndrewMcLaughlin
2 Comments
 
LVL 54

Accepted Solution

by:
nico5038 earned 400 total points
ID: 10730938
Hi Andrew,

Best to create a form with a combo for the quarter selection.
Best to extract Year & Quarter from the data your need to filter like:
select distinct format([datesales],"yyyyq") as YearQuarter from tblSales

Now you can use a reference to this form field (combo) in your queries to select the needed quarter.

Can you copy/paste a sample of one such selection queries ?

Nic;o)
0
 
LVL 17

Assisted Solution

by:walterecook
walterecook earned 100 total points
ID: 10731914
Just to talk a little philosophy around "I'm nervous about playing around with my database now that i've got it to work"
Just create a development copy and play in it.  This is good programming practice anyway and if something blows up, who cares, you still have your production db.

Walt
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now