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
|
|||
|
|||
Foreign Key not updating
Access 2000 with linked tables in SQL Server 2000. I have a form and a datasheet subform based on a table. This was not related to the parent table before and I was changing nvarchars to varchars and removed nulls. I noticed some Foreign keys were NULL? I copied data to new table and deleted the null FK. I then changed POID to not null. POID is PK in tblPO and FK in items. I have verified the SUBFORM is using POID for parent and child. I see the new row asterick on subform. The subform only has Item, Description, Qty, Code (DROPdown list) and resolved checkbox. The parent data already has been entered but every time I try to add a new data in subform I get error "ODBC-- call failed. the cannot insert NULL into column POID, column does not allow nulls. insert fails"? one other strange problem I started getting error "The value you entered isn't valid for this field" when I start typing in the subform?? Maybe that is part of the problem??? thanks CREATE TABLE [dbo].[tblPODiscrepancyItems] ( [PODiscID] [int] NOT NULL , [POID] [int] NOT NULL , [Item] [nvarchar] (50) NULL , [Description] [nvarchar] (50) NULL , [Qty] [int] NOT NULL , [code] [nvarchar] (50) NULL , [Resolved] [bit] NOT NULL , ] GO CREATE TABLE [dbo].[tblPurchaseOrder] ( [POID] [int] IDENTITY (1, 1) NOT NULL , [Date] [datetime] NULL , [DocNumber] [nvarchar] (20) NULL , [CompanyName] [nvarchar] (50) NULL , .... |
#2
|
|||
|
|||
Foreign Key not updating
I did not change anything in access mdb and I dont have any default
values, validation etc on any fields. I did make some changes in backend. I recreated the form with plain text boxes but I get the same errors. |
#3
|
|||
|
|||
Foreign Key not updating
I did not change anything in access mdb and I dont have any default values, validation etc on any fields. I dont use any validation, defaults etc. I did make some changes in backend which I have tried to reset. I changed all the Items table to nulls and removed the default value (back to what it was). I was able to add add data directly to Items table I created a new sub form based on a query with 5 plain text boxes but I get the same errors. It is linked to main form like others on POID. Should not have any defaults or validation? Item, Description, Qty, Code and resolved checkbox. Originally used Item, Description, Qty, Code (static DROPdown list) and resolved (checkbox) helP I am stuck and out of ideas?? |
#4
|
|||
|
|||
Foreign Key not updating
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Updating ODBC tables from Access Query | cg084 | Running & Setting Up Queries | 1 | August 30th, 2005 05:09 PM |
Auto populate a foreign field in a subform | ron b | General Discussion | 6 | March 24th, 2005 02:41 PM |
Edit foreign keys | jma | Running & Setting Up Queries | 0 | December 3rd, 2004 06:57 AM |
Table Wizard Does Not Set Relationship if Foreign Key and Primary Key Name Do Not Match Exactly in Case. | HDW | Database Design | 3 | October 16th, 2004 03:42 AM |
Complicated Databse w/many relationships | Søren | Database Design | 7 | July 13th, 2004 05:41 AM |