Validation Rule is there one for this scenario

G

Guest

When some one calls in they need to provide us with their acct number
so my form will look like this
Account Number__________________
Re-enter Account Number ________________
what I need is when the account number is re-entered if it does not match a
message populates that the two account numbers do not match please re-verify
numbers and re-enter.
How can I set this up.
Again, the caller has to provide us with the number...so we can not set this
up with a drop down.
 
G

Guest

In the second textbox property After Update run a macro. The condition of
the macro can do the compare the two textboxes for you. The macro can give
you a message if in error. If no error then proceed to the next action.
 
G

Guest

I will try it thank you

KARL DEWEY said:
In the second textbox property After Update run a macro. The condition of
the macro can do the compare the two textboxes for you. The macro can give
you a message if in error. If no error then proceed to the next action.
 
H

HKComputer

You can do this with code. Try this in the afterupdate event of the second
textbox. I've given your textboxes names here, txtAcctNo and txtReAcctNo.

Private Sub txtReAcctNo_AfterUpdate()

'Test for null in both text boxes first to eliminate errors
'Give a message box that tells the user about the missing account number
'Set Focus back to the correct text box

If Nz(txtAcctNo, "") = "" Then
MsgBox ("Account Number cannot be blank.")
Me.txtAcctNo.Setfocus
ElseIf Nz(txtReAcctNo, "") = "" Then
MsgBox ("Please reenter the account number.")
Me.txtReAcctNo.Setfocus
End If

'Test to see if the numbers in the textboxes match and then tell the
computer what to do if they do

If Me.txtAcctNo = Me.txtReAcctNo Then
'Now tell it what to do
Else: MsgBox ("Please reenter the account numbers. They do not match.")
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top