Avatar of SteveL13
SteveL13Flag for United States of America

asked on 

How copy everything from the first space

If I have this text in a field:

"1234 West Springfield Avenue"

How can I copy everything from the first space to another field?

In other words, the copied text would be "West Springfield Avenue"
Microsoft Access

Avatar of undefined
Last Comment
Jeffrey Coachman
Avatar of Bill Prew
Bill Prew

If you mean in a query then a calculation like below will extract the part you wanted.  Or were you looking for VBA code?

Right(Field1,Len(Field1)-InStr(Field1," "))

Open in new window


»bp
Avatar of SteveL13
SteveL13
Flag of United States of America image

ASKER

VBA Code.  Sorry.  I should have been more clear.
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
No Points wanted,
To get just the number you could use:
StreetNumber: Left([CustAddress],InStr([CustAddress]," "))


Not sure what you meant about "Copy"

But using these examples you could build a query like this to display the original field and the two "derived" fields, ...then you could "Use" the derived field anywhere you liked, without having to "copy" anything.
SELECT CustID,CustName, CustAddress, Left([CustAddress],InStr([CustAddress]," ")-1) AS CustStreetNumber, Right([CustAddress],Len([CustAddress])-InStr([CustAddress]," ")) AS CustStreetName
FROM tblCustomers;

User generated image
But again, ...no points wanted as Bill has answered your Q as posted, ...
I was just passing by...
;-)

Jeff
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo