About
Pricing
Community
Teams
Start Free Trial
Log in
Michael Paravicini
asked on
10/19/2018
InStr looking for spaces does not give the expected result
I am getting old but somehow the following code does not yield the desired result:
xName = "Steven Murray Thomas"
MsgBox InStr(1,xName," ")
gives zero and not the expected 7. Any help why?
Thank you so much Michael
Microsoft Access
VBA
6
2
Last Comment
Michael Paravicini
8/22/2022 - Mon
Gustav Brock
10/19/2018
No. It works fine for me - with a direct copy-paste - returns 7.
ASKER CERTIFIED SOLUTION
Jim Dettman (EE MVE)
10/19/2018
THIS SOLUTION 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
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Dale Fye
10/19/2018
THIS SOLUTION 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
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Subodh Tiwari (Neeraj)
10/19/2018
Or simply put this statement and see what number it returns. If it doesn't return 32, that means the white space is not the space character.
MsgBox Asc(Mid(xName, 7, 1))
Select all
Open in new window
Gustav Brock
10/19/2018
Or just delete your old code and copy-paste your own code here at top … that was what I did.
Your help has saved me hundreds of hours of internet surfing.
fblack61
Michael Paravicini
10/20/2018
ASKER
Thank you so much to all of you. It was indeed as Jim said. It as not a space but a ASCI 160 - I now simply replaced it with CHR(32) and it works fine! Thank you.. Cheers Michael