[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

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
0
sonmic
Asked:
sonmic
1 Solution
 
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now