A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Null Value/Allow Zero Length Issue



 
 
Thread Tools Display Modes
  #1  
Old June 9th, 2004, 10:45 PM
Lori
external usenet poster
 
Posts: n/a
Default 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  
Old June 10th, 2004, 07:58 AM
Van T. Dinh
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.