Delete an entry from a field

D

DeeMad

I have a form I use for entering the detail line items of Purchase Orders I
have done. There are several fields for entering the account number used for
each line, and each of the fields contains a Before Update event that checks
the account number I've entered against my list of accounts, to ensure I
don't enter an invalid account. If an invalid account is entered, I get a
pop up box telling me that it is not valid and won't let me leave the field
until it is corrected. This works beautifully. However, in the event that I
need to go back into the record and delete one of the account numbers I've
entered and leave the field blank, I get my little popup box telling me that
the account number is not valid and will not let me continue. Can I add
something to my code that will allow me to delete the entry and continue? I
am using Access 2003.
 
L

Linq Adams via AccessMonster.com

If I understand you correctly, wrap your validation code so that it doesn't
run if the Account number field is empty:

If Not IsNull(Me.AccountNumberField) Then
'Place your account number checking code here
End If

Now the code won't run if you delete the entry and leave it empty.
 

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