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

"In" Operator



 
 
Thread Tools Display Modes
  #1  
Old July 7th, 2005, 06:46 PM
Gwhit
external usenet poster
 
Posts: n/a
Default "In" Operator

If I have a text box named [States] on my [Workstation] form, and this text
box contains simple two-letter state codes with comma separators, for example
"AZ", "CO", "WA", etc, should I be able to reference this text box in the
criteria grid under a Project_State field with code along the lines of,
In(Forms![Workstation]![States])? I seem to be able to type only one state
reference into the text box with no surrounding quotes and receive a correct
return of data.

Thank you.

  #2  
Old July 7th, 2005, 06:58 PM
Klatuu
external usenet poster
 
Posts: n/a
Default

If your table field is a 2 character field containing one code, then the
answer is no. The query builder is not smart enough to know which of the
codes you want to use. Based on your post, I think you need to reconsider
your design. Can you tell me why you are using comma separatorated codes in
a text box when you need to look up only one?

"Gwhit" wrote:

If I have a text box named [States] on my [Workstation] form, and this text
box contains simple two-letter state codes with comma separators, for example
"AZ", "CO", "WA", etc, should I be able to reference this text box in the
criteria grid under a Project_State field with code along the lines of,
In(Forms![Workstation]![States])? I seem to be able to type only one state
reference into the text box with no surrounding quotes and receive a correct
return of data.

Thank you.

  #3  
Old July 7th, 2005, 07:22 PM
Gwhit
external usenet poster
 
Posts: n/a
Default

Sorry if the post wasn't clear enough. The "two-letter" code reference means
that the states are not spelled out in their entirety. They are dropped into
this hidden text box by way of a subform selection. For example, a person
may need to look up projects for only three states, so they select "CA",
which populates the unbound [States] text box. Then they select "AL" which
moves alongside the "CA" appearing as "CA", "AL", then "CO", showing as "CA",
"AL", "CO".

In other words, the text field is intended to be utilized as nothing but a
holder for the query criteria.

If your table field is a 2 character field containing one code, then the
answer is no. The query builder is not smart enough to know which of the
codes you want to use. Based on your post, I think you need to reconsider
your design. Can you tell me why you are using comma separatorated codes in
a text box when you need to look up only one?

"Gwhit" wrote:

If I have a text box named [States] on my [Workstation] form, and this text
box contains simple two-letter state codes with comma separators, for example
"AZ", "CO", "WA", etc, should I be able to reference this text box in the
criteria grid under a Project_State field with code along the lines of,
In(Forms![Workstation]![States])? I seem to be able to type only one state
reference into the text box with no surrounding quotes and receive a correct
return of data.

Thank you.

  #4  
Old July 7th, 2005, 08:47 PM
Klatuu
external usenet poster
 
Posts: n/a
Default

Okay, I did not get that. In this case, you will have to have another
textbox or combo box to give it just one state to look up at a time. The
other option would be to put something like [Enter State Code] in you query
and it will pop up a box that wil allow the user to enter a state.

"Gwhit" wrote:

Sorry if the post wasn't clear enough. The "two-letter" code reference means
that the states are not spelled out in their entirety. They are dropped into
this hidden text box by way of a subform selection. For example, a person
may need to look up projects for only three states, so they select "CA",
which populates the unbound [States] text box. Then they select "AL" which
moves alongside the "CA" appearing as "CA", "AL", then "CO", showing as "CA",
"AL", "CO".

In other words, the text field is intended to be utilized as nothing but a
holder for the query criteria.

If your table field is a 2 character field containing one code, then the
answer is no. The query builder is not smart enough to know which of the
codes you want to use. Based on your post, I think you need to reconsider
your design. Can you tell me why you are using comma separatorated codes in
a text box when you need to look up only one?

"Gwhit" wrote:

If I have a text box named [States] on my [Workstation] form, and this text
box contains simple two-letter state codes with comma separators, for example
"AZ", "CO", "WA", etc, should I be able to reference this text box in the
criteria grid under a Project_State field with code along the lines of,
In(Forms![Workstation]![States])? I seem to be able to type only one state
reference into the text box with no surrounding quotes and receive a correct
return of data.

Thank you.

 




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
like operator seth Running & Setting Up Queries 2 May 5th, 2005 07:32 PM
How to make the Operator a Variable? CaptainMyCaptain Running & Setting Up Queries 1 October 20th, 2004 03:05 PM
In operator question Tony Running & Setting Up Queries 3 September 22nd, 2004 03:57 AM
Missing Operator Problem Benjamin Running & Setting Up Queries 4 August 26th, 2004 01:34 PM
Graph against Operator Characters (ACCESS 2K) [email protected] Setting Up & Running Reports 1 July 22nd, 2004 04:48 PM


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