473,324 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Foreign Key not updating

we use 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 ,
....

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??

Feb 2 '06 #1
1 2194
the same subform works on a different form? Updates FK just fine. The
subform that works uses an outer join from main form. THe one that
does not work uses the non-outer side for main form. Subforms are
setup the same.

Feb 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jeremiah Jacks | last post by:
I just upgraded to MySQL 4.0.14-standard for RedHat Linux and am using = the pre-compiled binaries. I have a database with INNODB tables. When I insert a row into one of the child tables, I get...
2
by: geoff | last post by:
The table creation script(at the end of this post) works fine on 4.0.1-alpha-win, but the foreign key constraints fail on 4.0.15-win. I am starting the server with the same command for both...
10
by: Bodza Bodza | last post by:
I'm having an argument with an incumbent self-taught programmer that it is OK to use null foreign keys in database design. My take is the whole point of a foreign key is that it's not supposed...
31
by: Robert Brown | last post by:
Let's say I have a type hierarchy: (just an example) the general entity customer: CREATE TABLE customer(customer_id int, customer_name varchar(250), customer_type int) three specific...
1
by: James E | last post by:
I have a question about best practices of how to deal with lookup data from my C# apps. On a couple of occasions I have come across a problem where I have to automate inserting a record into a...
0
by: Scott Ribe | last post by:
I've got a problem which I think may be a bug in Postgres, but I wonder if I'm missing something. Two tables, A & B have foreign key relations to each other. A 3rd table C, inherits from A. A...
5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
10
by: Shawn Chisholm | last post by:
Hi, I am trying to deal with a deadlock situation caused by foreign key references on insert and I was wondering if anyone knows what order the foreign keys are locked (or evaluated) in for a...
1
by: Sreekanth | last post by:
I have a dataset with TableAdapter A and TableAdapter B. B has a foreign key which refer backs to A. I add a row to table A and then add several rows to Table B. I update ID of table A of table...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.