My Assistant
![]() ![]() |
|
|
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 |
|
|
|
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 |
|
|
|
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 |
|
|
|
Mar 1 2006, 08:40 AM
Post
#4
|
|
|
New Member Posts: 8 |
Thank you! I have exactly what I need!!
|
|
|
|
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 Top · Lo-Fi Version | Time is now: 19th May 2013 - 02:59 AM |