473,381 Members | 1,570 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,381 software developers and data experts.

New record results in blank foreign key in subform


I have a form with a subform. The mainform has a primary key ([ID]) and the subform has a foreign key ([MasterID]). When new records are added in the mainform, I get an error message that says, "ODBC -- Call Failed." The error message goes on to say that it cannot insert a null value into the column [MasterID], the foreign key in my subform.

[ID] and [MasterID] are in a one-to-one relationship. The data in the main form represents information at an initial state and the data in the subform represents an end state.

The error message seems to happen before the form's Before Insert event, so I am really at a loss as to how to fix this. I am new to SQL server. The backend files are on SQL server and the front end is running on Access in an MDB file.

Dec 27 '06 #1
1 1292
Sorry, I figured out what was going on - my relationship was not set up correctly. I had test data in my child table with no parent. This caused the relationship to save incorrectly.
Dec 28 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Alain Guichaoua | last post by:
Good evening to all Here is my problem : I have a form with a subform. They are linked. When I open the form I would like the subform to reach its last record. I tried the method...
by: William Wisnieski | last post by:
Hello Everyone, Access 2000, I have a main unbound form with a bound datasheet subform . The subform is bound to a query that returns records based on criteria in the main form. The user...
by: Joe Scully | last post by:
Hi all, I am having trouble with access adding a blank record to a subform everytime I finish entering data and closing the form. (The form and subform are based on the one table) When...
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
by: DS | last post by:
Whenever you use a continous form each row represents a record. Does this record have a number? If so how do you access it. Right now I have a field using auto number. But if access generates...
by: Stephen Poley | last post by:
I have the following situation: - a table of employees, keyed on employee-id; - a table of training sessions, keyed on session-id; - a requirement to log who was present at which session, plus...
by: jpatchak | last post by:
Hello, I'm hoping someone can help me. I have a mainform based on a table (let's call it tblMain) with a Primary Key of . There is a subform on this main form based on another table (let's call...
by: FNA access | last post by:
I have a mainform that has a subform in the detail section and a subform in the footer section.(Both subforms are in datasheet view) When I click the navigation button to create a new record on the...
by: Andy_Khosravi | last post by:
I'm having issues with updates being blocked due to some sort of record locking issue. The error does not occur consistently, so I've had a hard time nailing it down. It does happen enough to cause...
by: QntmPg | last post by:
Hi all, I have read through what I could find on previous questions regarding using the OpenArgs property, but I'm still not able to get my form to open correctly. I'm not sure exactly where the...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.