Null Value/Allow Zero Length Issue

L

Lori

Hello,
I have a form (Invoices) with a subform (InvDetails) where the subform
displays in datasheet view. Each line in the subform begins with an
activity field that is a combo box. The field is bound by a numeric column,
which is hidden, and displays the second column, which is text.
The problem I have is that my users tend to start a line, delete the value
they entered in this field, and then attempt to leave it. When they do,
they get the error
"You tried to assign the Null calue to a variable that is not a Variant data
type.
What kind of fix can I put in here? Since the value is a number, I can't
set it to allow zero length. I really need that row to be deleted when this
happens. I have not been able to find an event that supercedes the default
error from Access.

I am looking for any suggestions to work around this problem, but I am very
new to using VB code.
Thank you for your help,
Lori
 
V

Van T. Dinh

Try validating the data entry in the BeforeUpdate Event of
the SubForm.

You can also use the Undo method to cancel the data entry.

HTH
Van T. Dinh
MVP (Access)
 

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