My Assistant
![]() ![]() |
|
|
Feb 15 2007, 10:09 PM
Post
#1
|
|
|
New Member Posts: 5 From: Tasmania, Australia |
Without going into much detail about the structure of my forms and tables, I am getting the following warning when I try to insert a new record into the datasheet view of an existing table:
You tried to assign the Null value to a variable that is not a Variant data type. And then once I click on on the warning dialog, and try to enter a value again, I get the following error: Cannot insert the value NULL into column 'TestID', table.'dbo.TestResults'; column does not allow nulls. INSERT fails. I have been modifying the structure of my database a little in order to implement a few bits of new functionality, however I don't think I have done anything that could have caused this problem. I apologise for being so vague lol. Any ideas? |
|
|
|
Feb 15 2007, 10:34 PM
Post
#2
|
|
|
Retired Moderator Posts: 11,289 From: Milwaukee, WI |
Are you using SQL Server or Access? I see the "dbo" and that looks like a schema as used in SQL Server.
If so then there is probably a Constraint on the TESTID column that does not allow an empty (Null) value so some value must be put in that column. If this is an Access table then the Required property of that column (TESTID) is set to Yes or there is an index on that column that requires a unique value. Is TestID an AutoNumber (Access) or Identity (SQL Server) type of field? |
|
|
|
Feb 15 2007, 10:38 PM
Post
#3
|
|
|
New Member Posts: 5 From: Tasmania, Australia |
Ok the plot thickens...
I have a form that displays tests, and each test record has a sub form that displays all the individual components of the test. The warning and error I am getting only occurs if I try to add an individual component to the first test record. It works as intended if a 2nd test is created and components are assigned to it. This probably narrows down the possibilities a bit, but I am still lost. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 25th May 2013 - 07:35 AM |