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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Setting criteria to get reslts



 
 
Thread Tools Display Modes
  #1  
Old August 9th, 2009, 05:25 PM posted to microsoft.public.access.gettingstarted
lilczech
external usenet poster
 
Posts: 1
Default Setting criteria to get reslts

I created a tale for product specifications. The product names are formatted
ABC-123. They are selected using a combo box from another table.I am running
a simple query but cannot get it to run on my table. For the criteria, I
have [enter product name]. When the box comes up and I enter a product, the
query comes up blank. If I do not set the criteria, everything comes up
fine. I ran the same criteria on the table of product names where my tables
selects from and it works. I'm confused as to why I can't select in my
specifications table!!
  #2  
Old August 9th, 2009, 07:49 PM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Setting criteria to get reslts

On Sun, 9 Aug 2009 09:25:01 -0700, lilczech
wrote:

I created a tale for product specifications. The product names are formatted
ABC-123. They are selected using a combo box from another table.I am running
a simple query but cannot get it to run on my table. For the criteria, I
have [enter product name]. When the box comes up and I enter a product, the
query comes up blank. If I do not set the criteria, everything comes up
fine. I ran the same criteria on the table of product names where my tables
selects from and it works. I'm confused as to why I can't select in my
specifications table!!


I'm guessing that you're yet another victim of the Lookup Field misfeatu is
the product name field a Lookup Field in this table? If so what you SEE is
ABC-123, but what is actually STORED in the table (and therefore available to
the query criteria) is a meaningless number.

Try using a combo box as a criterion also (independent of the lookup field
issue): you can use a form (frmCrit let's call it) with an unbound Combo Box
(cboProduct), and a criterion

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

This will let the user select an existing product rather than needing to type
one in, and risk errors if they make a minor typo.
--

John W. Vinson [MVP]
  #3  
Old August 9th, 2009, 11:21 PM posted to microsoft.public.access.gettingstarted
John Spencer
external usenet poster
 
Posts: 2,364
Default Setting criteria to get reslts

Does your table that you are selecting from have another column that is
the primary key and is an autonumber field?

If so, the problem is probably that what you see is the descriptive text
name of the product, but what is actually stored is the ID number of the
row (the primary key).

If that is the case you should be able to enter a valid number to get a
record returned.

How you fix this depends on a number of factors. So test this and if
entering a valid product number works, post back.

'================================================= ===
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'================================================= ===


lilczech wrote:
I created a tale for product specifications. The product names are formatted
ABC-123. They are selected using a combo box from another table.I am running
a simple query but cannot get it to run on my table. For the criteria, I
have [enter product name]. When the box comes up and I enter a product, the
query comes up blank. If I do not set the criteria, everything comes up
fine. I ran the same criteria on the table of product names where my tables
selects from and it works. I'm confused as to why I can't select in my
specifications table!!

 




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 10:58 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.