Avoid double descriptions

Hallo,

I have a large table with projects. The problem is that everyone can put in new projects.
User 1 puts in project : sannest vat 7320
User 2 can't find the project and set it to sannest vat7320. Two different projects.
I would like to check the description before updating and set a msgbox but everything I've tried so far is not working properly.
An idee?

TX
sonmicAsked:
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.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You can use either Form or Control BeforeUpdate to do this, but you'll have a difficult time determining duplicates with data like that, since "sannest vat 7320" is not the same as "sannest vat7320".

You could try removing all the space characters and comparing those two, but that could be tricky (since you'd also have to remove the space characters from ALL the descriptions in the table, which could be a very large performance hit). It also might or might not do what you like.

You could build a small routine that looks for the first "word" of that description, and then displays a MsgBox if a match is found. You could use the LIKE operator for this, in a simple SQL statement.

Or you could use  a Combobox with AutoComplete to allow your users to enter the Description. This way, when User2 types in "sannest" they willl see that someone has already entered "sannest vat 7320" and will (hopefully) select that one.

If User2 doesn't find it, then you can use the NotInList event of the Combo to add your description. The article below shows how to do that:

http://www.databasedev.co.uk/not_in_list.html

The only real trouble with that is the Recordsource of that combo. You'd have to set it to something like "SELECT DISTINCT Description FROM YourTable". This would show all the current descriptions in your Projects table.
0

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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.