A problem with a simple query MS Access 10

Clive Beaton
Clive Beaton used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Clive BeatonAccess Developer

Author

Commented:
DB attached.
Database1.accdb
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
Top Expert 2007

Commented:
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 Developer

Author

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.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
Top Expert 2007

Commented:
more data
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
Top Expert 2007

Commented:
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 / Application Developer
Top Expert 2007

Commented:
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 / Application Developer
Top Expert 2007

Commented:
Two out of three of the numbers in the combo are not in the Import table.
So ... it's actually working correctly ...
Database Architect / Application Developer
Top Expert 2007
Commented:
This works ... when all combo values are in the Import Table.
Database1MX01.accdb
Clive BeatonAccess Developer

Author

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 / Application Developer
Top Expert 2007

Commented:
Cool.  Don't forget to close the question :-)
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
Top Expert 2007

Commented:
OP confirmed that  my solution worked

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial