A problem with a simple query MS Access 10

I have a simple query that I use to populate a listbox with transactions, selecting the required account by preloading a property.  It will select one account but not the other.

I have attached a small simple test database to demonstrate the problem.

This is driving me mad and I would greatly appreciate any help I can get.

Thanks in advance,

Clive
Clive BeatonAccess DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Clive BeatonAccess DeveloperAuthor Commented:
DB attached.
Database1.accdb
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
There is something wrong with the data in the 2/3 values in the combo

see image - note Spaces or what ever they aredata
Clive BeatonAccess DeveloperAuthor Commented:
Thanks, Joe.

Can you suggest any way of discovering what the leading characters are?  Standard Access things I've tried, don't throw any light.
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
more data
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Well ... not sure that is the problem.  Notice the combo  box account selected above is not in Import table.  So that is the actual problem
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
The spaces are WEIRD.  In the Immediate Window, Trim removes the Spaces ... so they must be spaces.
Not sure what is going on
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Two out of three of the numbers in the combo are not in the Import table.
So ... it's actually working correctly ...
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
This works ... when all combo values are in the Import Table.
Database1MX01.accdb

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Clive BeatonAccess DeveloperAuthor Commented:
Thanks, Joe.

I changed the query on the account field to read the accounts table, and one of the account numbers was corrupted.  Fixed that and now all is good.

Clive
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Cool.  Don't forget to close the question :-)
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
OP confirmed that  my solution worked
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.