Avatar of Clive Beaton
Clive Beaton
Flag for Australia asked on

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
Microsoft Access

Avatar of undefined
Last Comment
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

8/22/2022 - Mon
Clive Beaton

ASKER
DB attached.
Database1.accdb
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

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 Beaton

ASKER
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.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

more data
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

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 - Former Microsoft Access MVP)

The spaces are WEIRD.  In the Immediate Window, Trim removes the Spaces ... so they must be spaces.
Not sure what is going on
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

Two out of three of the numbers in the combo are not in the Import table.
So ... it's actually working correctly ...
ASKER CERTIFIED SOLUTION
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

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.
Clive Beaton

ASKER
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 - Former Microsoft Access MVP)

Cool.  Don't forget to close the question :-)
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

OP confirmed that  my solution worked