Null Values - WHY am I getting this error? 
Author Message
 Null Values - WHY am I getting this error?

The following code:

txtaddress.Text = strAddress
mrs![Address] = strAddress

This is with an Access database.  I knew that Visual Basic variables
(excluding variants of course) couldn't handle a null value, but I
thought Access could.  I thought MOST databases could...  Is there a
different DAO reference I could use?

Or do I have to do:

If Not IsNull(strAddress) Then
        mrs![Address] = strAddress
End If

That would be a pain to do it with every single value.

Thanks for any help,
-Steve Job



Sat, 21 Jul 2001 03:00:00 GMT  
 Null Values - WHY am I getting this error?
Well, is the field NULLable?  If not, an easy way to do this without
an IF statement is:
txtaddress.Text = "" & strAddress
This forces the data to not be NULL, assuming that it is strAddress
that has the offending NULL.

Good Luck,
Dean Thompson


Quote:
>The following code:

>txtaddress.Text = strAddress
>mrs![Address] = strAddress

>This is with an Access database.  I knew that Visual Basic variables
>(excluding variants of course) couldn't handle a null value, but I
>thought Access could.  I thought MOST databases could...  Is there a
>different DAO reference I could use?

>Or do I have to do:

>If Not IsNull(strAddress) Then
>    mrs![Address] = strAddress
>End If

>That would be a pain to do it with every single value.

>Thanks for any help,
>-Steve Job




Sat, 21 Jul 2001 03:00:00 GMT  
 Null Values - WHY am I getting this error?

I figured this out, but is there a way to get the
"Allow Zero Length" automatically set to "True" in Access?

Thanks for any help,
-Steve


: The following code:

: txtaddress.Text = strAddress
: mrs![Address] = strAddress

: This is with an Access database.  I knew that Visual Basic variables
: (excluding variants of course) couldn't handle a null value, but I
: thought Access could.  I thought MOST databases could...  Is there a
: different DAO reference I could use?

: Or do I have to do:

: If Not IsNull(strAddress) Then
:       mrs![Address] = strAddress
: End If

: That would be a pain to do it with every single value.

: Thanks for any help,
: -Steve Job



Sat, 21 Jul 2001 03:00:00 GMT  
 Null Values - WHY am I getting this error?

Does anyone have VB code that will go through a table
and change all the "Allow Zero Length" flags for all
text values to "True".
Or does anybody know how to change the flag to True
by default?

Thanks for any help,
-Steven Job


: The following code:

: txtaddress.Text = strAddress
: mrs![Address] = strAddress

: This is with an Access database.  I knew that Visual Basic variables
: (excluding variants of course) couldn't handle a null value, but I
: thought Access could.  I thought MOST databases could...  Is there a
: different DAO reference I could use?

: Or do I have to do:

: If Not IsNull(strAddress) Then
:       mrs![Address] = strAddress
: End If

: That would be a pain to do it with every single value.

: Thanks for any help,
: -Steve Job



Sat, 21 Jul 2001 03:00:00 GMT  
 Null Values - WHY am I getting this error?

I figured out about the "Allow Zero Length" boolean flag after my
original post.  But what I still couldn't figure out is how to
make the "allow Zero Length" flag to be True by default.  Or the
VB code to change the boolean flag to True.

The program I'm developing is creating a table and is then inserting
in values depending on the user input.  The input may be nothing.
At no time is anyone going to go into Access and change the "Allow Zero
Length Values".  So I'm at a stop sign right now.

Thanks for any help,
-Steve


: Does anyone have VB code that will go through a table
: and change all the "Allow Zero Length" flags for all
: text values to "True".
: Or does anybody know how to change the flag to True
: by default?

: Thanks for any help,
: -Steven Job


: : The following code:

: : txtaddress.Text = strAddress
: : mrs![Address] = strAddress

: : This is with an Access database.  I knew that Visual Basic variables
: : (excluding variants of course) couldn't handle a null value, but I
: : thought Access could.  I thought MOST databases could...  Is there a
: : different DAO reference I could use?

: : Or do I have to do:

: : If Not IsNull(strAddress) Then
: :     mrs![Address] = strAddress
: : End If

: : That would be a pain to do it with every single value.

: : Thanks for any help,
: : -Steve Job



Sat, 21 Jul 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. why am I getting this error??

2. Please Help: Why am I now getting this error

3. Why am I getting this error ?

4. Why am I getting this message?

5. Why am I getting a Closed Recordset

6. getting crazy with null values

7. VB4 16-bits: I am getting an error message when compiling

8. I am getting errors I can't pin down

9. i am getting error sending stdPic to out-of-Process Component

10. Help - I am getting an error using data control

11. I am getting an error Please help if you can

12. How can I pass NULL value to WinAPI which is expecting a NULL pointer

 

 
Powered by phpBB® Forum Software