You tried to assign the Null value to a variable that is not a Variant data type (1 Viewer)

cliftonx

Registered User.
Local time
Yesterday, 19:45
Joined
Mar 4, 2010
Messages
27
I'm trying to update a Description field on a input form by replacing it with a null/spaces. But when I move on onto the next field I get an error message; "You tried to assign the Null value to a variable that is not a Variant data type." I'm using a SQL Server backend. When I look at the table the field resides in and view the data type for Description field its defined as "not null". I changed the Description field within the table and made it "null" instead of "not null". But the same error keeps popping up. What am I doing wrong?
 

June7

AWF VIP
Local time
Yesterday, 16:45
Joined
Mar 9, 2014
Messages
5,470
Maybe need to disconnect the table and relink.
 

Minty

AWF VIP
Local time
Today, 01:45
Joined
Jul 26, 2013
Messages
10,371
If relinking doesn't work then use "" instead of null to "empty" the field.

You could use a query to update the field value, but you can't set a VBA string variable to Null, which is where you normally see this error.
 

cliftonx

Registered User.
Local time
Yesterday, 19:45
Joined
Mar 4, 2010
Messages
27
I've relinked the table and used a query to update the field value. But still getting the same error message.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:45
Joined
Feb 19, 2002
Messages
43,266
When you view the properties of the linked table, what does Access show for the AllowZeroLength property? What does it show for the Required property?
 

cliftonx

Registered User.
Local time
Yesterday, 19:45
Joined
Mar 4, 2010
Messages
27
After further review of the DSN names used at our shop. We are currently maintaining 3 environments (Production, Development and Test). When I Altered the table in our Development environment in SQL Server. Everything worked fine. However, I used the TEST environment for the DSN name. After relinking the table, It appeared to have worked fine on the relinking process, but upon my review, I noticed that I inadvertently used the TEST environment instead of the Development. After noticing this error, I reran the relink process with the correct Development DSN name. Everything worked as it should with no problems. The frontend form now allows me to go to the field that was altered, zap out the current data without displaying an error message. Oops, my bad. Thanks, for all your expert advice.
 

Users who are viewing this thread

Top Bottom