Solved

Check for Duplicate from a Textbox

Posted on 2011-09-26
5
213 Views
Last Modified: 2012-05-12
Hi Experts –

I need some help check for duplicates from a form. I want to check and see if my customer is entering a duplicate number in the form and prompt them that they shouldn’t be. I have some code but it’s not working as expected.

You can grab a number from the CLAIMNBR field on the form via copy and paste. Select new record from the record selector paste that number in the CLAIMNBR field tab off the field and a message box should come up tells you it’s a duplicate in the table.

I have code behind the form behind the txtClaimNbr textbox on the BeforeUpdate event.

That’s how I would like it to work.

As always any help is appreciated.

***** see example database *****  


Thanks in advance,

GeneBat

checkdupsfromtextbox.mdb
0
Comment
Question by:GeneBat
  • 3
  • 2
5 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 total points
ID: 36601383
Try this - attached


checkdupsfromtextbox-MX01.zip
0
 

Author Closing Comment

by:GeneBat
ID: 36601682
Works great. Thanks!
0
 
LVL 75
ID: 36601703
Did you see the change I made?

Removed code from Form BU event, put in text box BU event.

Also, your table name was misspelled in the DLookup().

mx
0
 

Author Comment

by:GeneBat
ID: 36601789
Yes I did. I should have been using the BU event in the Textbox and not the Form. Again thanks a second pair of eyes is alway good. :)
0
 
LVL 75
ID: 36601803
You are welcome ...

mx
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Correct ordering 16 48
Combobox issue 4 27
Copy a row in MS Access but with some field values changed 8 27
Join vs where 2 0
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now