If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Null Value/Allow Zero Length Issue
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 |
#2
|
|||
|
|||
Null Value/Allow Zero Length Issue
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) -----Original Message----- 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 . |
Thread Tools | |
Display Modes | |
|
|