Confirm Entry

SMatthews

Registered User.
Local time
Today, 14:14
Joined
Nov 13, 2001
Messages
38
I have a form where I would like the user to re-enter the same information twice and return an error message if the confirmation does not match the origianl entry. I have the first field bound and the second one unbound with an If/Then clause tied to the AfterUpdate event of the field but I can't seem to get it to work. Any suggestions?
 
Nevermind. I figured it out. I do have a second problem though. When I go to a new record, the information that I typed in the unbound textbox is st5ill there. Is there a way to erase that everytime I go to a new record?
 
What you need to do is put code on the BEFORE UPDATE event. In other words, it will check BEFORE the record gets updated.

Do something like this:

Private Sub txtMyTextBox_Before_Update
Dim strTextVal1 As String, strTextVal2 As String

strTextVal1 = txtMyTextBox
strTextVal2 = InputBox("Please re-enter the information to verify", "DATA VERIFICATION")

If strTextVal2 <> strTextVal1 Then
MsgBox "Sorry, values did not match, please re-enter the data", vbExclamation, "DATA ENTRY ERROR"
txtMyTextBox.Undo
Exit Sub
End If

End Sub

BL
hth
 

Users who are viewing this thread

Back
Top Bottom