Solved

Check for Duplicate from a Textbox

Posted on 2011-09-26
5
224 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error in query expression 3 37
data analyst 3 50
Cross Tab with two column values 7 38
How to make query not show results in table form go straight to report 4 22
This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

862 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

27 Experts available now in Live!

Get 1:1 Help Now