Solved

Identifyng one word or two in a field

Posted on 2011-09-12
4
299 Views
Last Modified: 2012-05-12
I have a field which somtimes includes two words and I only need the first word.  I can use this to show only the first word:
Group1: Left$([Group],InStr(1,[Group]," ")-1)
But when I use it I get #ERROR for all of the fields that only have one word.  How do identify the field has one or two words so I can skip if it only has one word?

Thanks.
0
Comment
Question by:ScootterP
  • 2
  • 2
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36524940

try this

Group1: Left$([Group] & " ",InStr(1,[Group]," ")-1)
0
 

Author Comment

by:ScootterP
ID: 36524991
Still getting #ERROR for the fields that have one word.
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 36525000


Group1: Left$([Group] & " ",InStr(1,[Group] & " "," ")-1)
0
 

Author Closing Comment

by:ScootterP
ID: 36525024
That did it.  I was about to say that I am importing from an Excel spreadsheet so the space might have some sort of funny format.

Thanks.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question