query returns nothing

I imported a spreadsheet into tbl_A.
I imported a text file into tbl_B.

tbl_A that has corresponding information on tbl_B.  I verified this by manually searching tbl_B using a few of the entries from tbl_A -- and was able to locate the corresponding rows.

Next I created a select query joining the two tables on 'userid' -- but no records are returned.

The 'userid' field in both tables is formatted as Text.  The only difference is the size of the field.  But even when I make the field sizes the same -- I don't get any results......

Here is the query SQL:

SELECT tbl_A.UserID, tbl_B.UserID, tbl_B.LastName, tbl_B.FirstName
FROM tbl_A INNER JOIN tbl_B ON tbl_A.UserID = tbl_B.UserID;

Any ideas why I'm not getting expected results?

Thank you,
Jeanne ElmuccioAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Ess KayEntrapenuerCommented:
Use trim

SELECT tbl_A.UserID, tbl_B.UserID, tbl_B.LastName, tbl_B.FirstName
FROM tbl_A INNER JOIN tbl_B ON trim(tbl_A.UserID) = trim(tbl_B.UserID)

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
Jeanne ElmuccioAuthor Commented:
Thanks!!!  worked perfectly...

Ess KayEntrapenuerCommented:
problem was, you not only had diffent fields, but also spaces in the field
So username "MY USERNAME" <> " MY USERNAME"

You might want to make the program, so that all spaces are removed from the beginning and end of the fields before saving
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.