UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Validate data entry in a form control by re-entering the data    
 
   
huntjumper
post Feb 28 2006, 03:56 PM
Post #1

New Member
Posts: 8



Hi

I use a form in which the user enters a six digit item number into a control. Before proceeding to the next control, I would like to have a pop up inputbox ask the user to re-enter the six digit item number. If the two entries match, the focus moves to the next control. If the two entries do not match, I would like to have the first control cleared and prompt the user to re-enter the six digit item number before proceeding to the next control.

Is there a code to handle this task?

THANK YOU
Go to the top of the page
 
+
NoahP
post Feb 28 2006, 04:00 PM
Post #2

Retired Moderator
Posts: 10,493
From: Lexington/Louisville KY USA



Use the Before Update event of the control:

If InputBox("Confirm Item Number:", "Confirmation Required") <> Me.YourControlName Then
MsgBox "Entries do not match!", vbOKOnly + vbCritical
Cancel = True
End If

Change YourControlName to the name of the control in question.

HTH
Noah
Go to the top of the page
 
+
freakazeud
post Feb 28 2006, 04:01 PM
Post #3

UtterAccess VIP
Posts: 31,413
From: NC, USA



Hi,
welcome to UA forums.
Try this on the before update event of the form:

Dim strValue

strValue = InputBox("Enter Value again", "Value required")

If strValue = "" Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Cancel = True
ElseIf strValue <> Me.YourControl Then
MsgBox "Doesn't Match", vbInformation, "Required Data"
Me.YourControl = Null
Cancel = True
End If

Untested, but should get you the idea.
HTH
Good luck
Go to the top of the page
 
+
huntjumper
post Mar 1 2006, 08:40 AM
Post #4

New Member
Posts: 8



Thank you! I have exactly what I need!!
Go to the top of the page
 
+
freakazeud
post Mar 1 2006, 09:17 AM
Post #5

UtterAccess VIP
Posts: 31,413
From: NC, USA



You're welcome.
Glad we could assist.
Good luck on future projects!
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th May 2013 - 02:59 AM