Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data comparison / InputBox v. TextBox

Status
Not open for further replies.

corbitt

MIS
Feb 22, 2002
73
US
I have one field (accountnumber) on a form where the user enters a credit card accountnumber. After the account number is entered (After Update), I want to display an InputBox (string variable (because they can enter hyphens):NumberInput) where they will enter the account number again. Then I want to compare the two number sets, and if they are different, I want to clear the value of accountnumber and setfocus to accountnumber.

Thank you in advance for your help.

Jeremy
 
Jeremy, give me one more chance then I'll give way if I can't help you. Since you only have one text box on the form, you shouldn't have to set focus to it. Under Tools-Options-Keyboard, be certain that the "Cursor stops at last field" checked; otherwise, with only one control on the form, you move to the next record after you leave the textbox. Then:

In the After_Update event of the AccountNumber text box place this code:
dim x as string
x = InputBox("Enter Account Number again")
If x <> AccountNumber then
AccountNumber = Null
Endif

If you have another control on the form which can receive focus, then use AccountNumber.SetFocus after setting Null.

mac

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top