huntjumper
Feb 28 2006, 03:56 PM
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
NoahP
Feb 28 2006, 04:00 PM
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
freakazeud
Feb 28 2006, 04:01 PM
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
huntjumper
Mar 1 2006, 08:40 AM
Thank you! I have exactly what I need!!
freakazeud
Mar 1 2006, 09:17 AM
You're welcome.
Glad we could assist.
Good luck on future projects!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.