A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query criteria



 
 
Thread Tools Display Modes
  #1  
Old November 28th, 2005, 04:32 AM posted to microsoft.public.access.tablesdbdesign
external usenet poster
 
Posts: n/a
Default Query criteria

Is it possible to set the criteria of a query at runtime rather than in
design view?
  #2  
Old November 28th, 2005, 04:46 AM posted to microsoft.public.access.tablesdbdesign
external usenet poster
 
Posts: n/a
Default Query criteria

Steve wrote:

Is it possible to set the criteria of a query at runtime rather than in
design view?


Certainly it's possible. And easy, too, if you don't mind using VBA. :-)

Seriously, you could affect the way a Query runs in various ways, such
as setting a control on a Form to have a value that the Query could
read, or defining a [Parameters] Table (I usually put just one record in
it) containing a field that your Query can read, etc.

What do you want the Query to do? How do you want to be able to change
how it runs?

-- Vincent Johns
Please feel free to quote anything I say here.
  #3  
Old November 28th, 2005, 05:26 AM posted to microsoft.public.access.tablesdbdesign
external usenet poster
 
Posts: n/a
Default Query criteria

On Sun, 27 Nov 2005 20:32:04 -0800, "Steve"
wrote:

Is it possible to set the criteria of a query at runtime rather than in
design view?


A Parameter Query is a pretty standard technique to do this. Rather
than a parameter like "Jones" you can use a prompt in square brackets,
such as [Enter last name:]

Even better, you can create a Form with unbound controls, and use

[Forms]![NameOfForm]!{NameOfControl]

as the criterion. The query will look to the form for the user's
input.


John W. Vinson[MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL query showing diff between actual and budget Bon Running & Setting Up Queries 3 August 25th, 2005 12:07 PM
criteria in a query Ulcom Using Forms 1 December 16th, 2004 08:49 PM
Report Criteria: Query works, but report doesn't call up query??? BARKAROO New Users 5 October 18th, 2004 06:35 PM
Big number gives error! Sara Mellen Running & Setting Up Queries 8 October 11th, 2004 02:48 AM
Specifying no criteria in a query Big Tony Running & Setting Up Queries 1 August 12th, 2004 01:09 AM


All times are GMT +1. The time now is 12:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.