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  

How to select characters in a field?



 
 
Thread Tools Display Modes
  #1  
Old April 11th, 2008, 07:41 PM posted to microsoft.public.access.gettingstarted
Steel Banana
external usenet poster
 
Posts: 9
Default How to select characters in a field?

I need to create criteria in a query. It must select records where the first
3 characters in the field are the same as 3 characters in a text box on some
form.

I'm sure this is an easy one. I've done this before...somewhere...but I
can't recall how to do it!
--
Chris
  #2  
Old April 11th, 2008, 08:00 PM posted to microsoft.public.access.gettingstarted
John Spencer
external usenet poster
 
Posts: 7,815
Default How to select characters in a field?

Try

Field: SomeField
Criteria: Like Left([Forms]![Name of your Form]![Name of Control],3) & "*"

SELECT ...
FROM ...
WHERE [SomeField] Like Left([Forms]![Name of Form]![Name of Control],3) & "*"


John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County

Steel Banana wrote:
I need to create criteria in a query. It must select records where the first
3 characters in the field are the same as 3 characters in a text box on some
form.

I'm sure this is an easy one. I've done this before...somewhere...but I
can't recall how to do it!

  #3  
Old April 11th, 2008, 08:04 PM posted to microsoft.public.access.gettingstarted
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default How to select characters in a field?

Like [Forms]![SomeFormName]![TextBoxName] & "*"
--
KARL DEWEY
Build a little - Test a little


"Steel Banana" wrote:

I need to create criteria in a query. It must select records where the first
3 characters in the field are the same as 3 characters in a text box on some
form.

I'm sure this is an easy one. I've done this before...somewhere...but I
can't recall how to do it!
--
Chris

 




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 02:49 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.