View Single Post
  #4  
Old December 5th, 2006, 01:10 AM posted to microsoft.public.access.forms
syedalna via AccessMonster.com
external usenet poster
 
Posts: 9
Default duplicate number with messagebox & textbox

Al Campagna,

Your code is what i'm looking for.

It did identified the duplication & show the message box of the textbox2...
and ADD the record to the table.. I need to have a "Yes" & "No" on the
message box..where
if "Yes" = it will add the record that enter
if "No"= it will Not add the record and the form will return to it natural
state of Add New Data Entry (Add New Record).


Could you show me the code. I do appreciate it very much.

Thanks for your code

Al Campagna wrote:
syedalna ,
Use the BeforeUpdate event of TextBox1 to do a Dlookup against all the other
TextBox1 values in your table.
If so... set Cancel = True.
If not...continue normally

Not sure I understand the MsgBox you want to display on dupes... but...

Dim Prompt as String
Dim Title as String
Prompt = Me.TextBox2
Title = "Duplicate Value"
MsgBox Prompt, vbOKOnly, Title

i have a subform, textbox1 is number format and textbox2 is text format..and
both are not a primarykey. subform data is from query (though this will help).

[quoted text clipped - 5 lines]

Thank you in advane


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200612/1