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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

I need to build a query that asks for a record



 
 
Thread Tools Display Modes
  #1  
Old July 11th, 2008, 01:55 PM posted to microsoft.public.access.queries
Gina
external usenet poster
 
Posts: 198
Default I need to build a query that asks for a record

I would like to build a query so that when you open it, it asks you for
information before it can open the query. I think it has something to do with
expression builder, but I'm not sure of the code.

Example: Clicking on the query then access asking you for product number.
You type it in then only those items appear.

Thanks in advance!
  #2  
Old July 11th, 2008, 02:24 PM posted to microsoft.public.access.queries
Golfinray
external usenet poster
 
Posts: 1,597
Default I need to build a query that asks for a record

Parameter queries ask you to input information and uses that information in
the query. Read your help files for parameter queiries.

"Gina" wrote:

I would like to build a query so that when you open it, it asks you for
information before it can open the query. I think it has something to do with
expression builder, but I'm not sure of the code.

Example: Clicking on the query then access asking you for product number.
You type it in then only those items appear.

Thanks in advance!

  #3  
Old July 13th, 2008, 09:42 AM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default I need to build a query that asks for a record

On Fri, 11 Jul 2008 05:55:01 -0700, Gina
wrote:

I would like to build a query so that when you open it, it asks you for
information before it can open the query. I think it has something to do with
expression builder, but I'm not sure of the code.

Example: Clicking on the query then access asking you for product number.
You type it in then only those items appear.

Thanks in advance!


Golfinray is correct: you need a parameter query. Fortunately they're easy.

You don't need the expression builder at all. Instead, just create a Query
selecting the fields that you want to see and to search. In the query grid, on
the Criteria line under the [Product Number] field, put

[Please enter product number:]

When you run the query you'll be prompted with the text between the brackets,
and the user's entry will be used as the criterion.

Better: create a little form frmCrit with a combo box selecting all the valid
product numbers (cboProduct let's call it). Use a criterion of

=[Forms]![frmCrit]![cboProduct]

Put a command button on frmCrit to open whatever Form or Report uses your
query; select the product, and click the button. Note that users should in
general never need to see a Query or a Query datasheet!
--

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


All times are GMT +1. The time now is 11:00 AM.


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