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  

Criteria - multiple column table



 
 
Thread Tools Display Modes
  #1  
Old June 25th, 2004, 04:44 PM
Sophisticated Penguin
external usenet poster
 
Posts: n/a
Default Criteria - multiple column table

I am using Access 2002. I have fields where the entry is picked from a table with 2 columns. One column is an ID number, the other is a word or phrase. When I run a query, I want to be able to define the criterion either by the number OR by the phrase. However, as far as I can tell, Access always assumes that the value will be referring to the first column of the table (or the first column that has been selected, if only certain columns have been selected). How can I specify which column it will look in to match my specified criterion?
Thanks!
  #2  
Old June 29th, 2004, 02:38 AM
Dale Fye
external usenet poster
 
Posts: n/a
Default Criteria - multiple column table

Sophi,

I assume you are using the query grid to build your query. If so, you add
the fields you want in the query, go to the column you want in your
criteria, and in the criteria line, enter your value. Then, in the second
column you want in your query, drop down to the second criteria line and
enter the value for that column.

HTH

Dale

"Sophisticated Penguin" Sophisticated
wrote in message ...
I am using Access 2002. I have fields where the entry is picked from a

table with 2 columns. One column is an ID number, the other is a word or
phrase. When I run a query, I want to be able to define the criterion
either by the number OR by the phrase. However, as far as I can tell,
Access always assumes that the value will be referring to the first column
of the table (or the first column that has been selected, if only certain
columns have been selected). How can I specify which column it will look in
to match my specified criterion?
Thanks!



  #3  
Old June 29th, 2004, 10:57 AM
Sophisticated Penguin
external usenet poster
 
Posts: n/a
Default Criteria - multiple column table

Hi Dale,

I assume you are using the query grid to build your query.

That's right.
If so, you add
the fields you want in the query, go to the column you want in your
criteria, and in the criteria line, enter your value. Then, in the second
column you want in your query, drop down to the second criteria line and
enter the value for that column.


Hmmm... The problem is that I can't get the fields into the columns in the first place. My database is set up so that there is a main table (for holding the records) and other tables containing the options for combo boxes (used in the main table, forms etc). These other tables have an autoID number and a combo box option on each row (i.e. 2 columns) If I set up the combo boxes on the main table using SELECT to choose the appropriate column for the row source(the one containing the option words), then the query will only recognize criteria consisting of the option words. If I set up the combo boxes so that both columns are actually there but the first column is hidden (width 0cm), (this still shows the correct list of options in the combo box), the query only recognizes criteria consisting of the autoID numbers from the first column.

The problem is that there are times when it would be useful to use the number in the query (to avoid typing several words), but other times when it would be more convenient to use the ID number. Is it possible to do both? The alternative would be if it were possible to get a drop down list of suggestions for entering the criteria - then I could just use the text column rather than the autoID numbers.

thanks!
SP
  #4  
Old June 29th, 2004, 11:59 AM
Sophisticated Penguin
external usenet poster
 
Posts: n/a
Default Criteria - multiple column table

Hi again,

Sorry - I've just realized that I was being really slow... I now realize that you meant for me to add the extra tables into my query as well as my main table - that way I can choose whether to use the text column or the AutoID column. Thanks for your help!
SP
 




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
Northwind Mike Database Design 3 May 21st, 2004 03:03 PM
DSUM Criteria and Excel Help Earl Kiosterud Worksheet Functions 2 April 30th, 2004 07:55 PM
Add column to existing pivot table? Sue Worksheet Functions 1 April 22nd, 2004 06:15 PM
Pivot table from multiple consolidation ranges - Bug? Louise Worksheet Functions 1 February 12th, 2004 04:20 AM
Looking up multiple criteria and returning a matching column Martin Young Worksheet Functions 2 October 22nd, 2003 10:07 AM


All times are GMT +1. The time now is 09:37 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.