473,491 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Table relations

Please help if you can.

I created a table to relate to another. I believe that I created it
correctly with all the requirements. I even checked my steps out of a
mcGraw 2003 book.

The problem is that the second table with the foreign key does not create a
new record and thus the data is not saved. I know I can add some code to
get this done but I have a perfectly working example that does not have any
code to create a record. I cannot see any difference in this example an my
work. I also tried some code but it did not get any results.

I did set the referential intergrity tick on.

Any help would be appreciated.
Nov 13 '05 #1
3 1468

martin wrote:
Please help if you can.

I created a table to relate to another. I believe that I created it
correctly with all the requirements. I even checked my steps out of a mcGraw 2003 book.

The problem is that the second table with the foreign key does not create a new record and thus the data is not saved. I know I can add some code to get this done but I have a perfectly working example that does not have any code to create a record. I cannot see any difference in this example an my work. I also tried some code but it did not get any results.

I did set the referential intergrity tick on.

Any help would be appreciated.

So you follow these steps and it still doesn't work?:
1. make sure you include the primary key of your parent table in the
child table. Also, make sure the types are compatible (If your parent
table's PK is an autonumber, use Long integer as the child record's
*foreign* key.)
2. create relationship between child and parent tables.
3. create child form.
4. create parent form, and drop child form into it.
5. check the Master/Child record stuff. It should already be filled
in. If not, select the fields relating the two tables together.

And if you create a parent record, can you add a child record? You can
NOT add a child record (e.g. Invoice Line Item) without first creating
a parent record (e.g. Invoice).

Nov 13 '05 #2
I was hoping to do this without sub forms as my example does. I got it
working the way you described. How can I stop the record navigation bar
from displaying in the sub form.

Thanks for the help.
<pi********@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

martin wrote:
Please help if you can.

I created a table to relate to another. I believe that I created it
correctly with all the requirements. I even checked my steps out of

a
mcGraw 2003 book.

The problem is that the second table with the foreign key does not

create a
new record and thus the data is not saved. I know I can add some

code to
get this done but I have a perfectly working example that does not

have any
code to create a record. I cannot see any difference in this example

an my
work. I also tried some code but it did not get any results.

I did set the referential intergrity tick on.

Any help would be appreciated.

So you follow these steps and it still doesn't work?:
1. make sure you include the primary key of your parent table in the
child table. Also, make sure the types are compatible (If your parent
table's PK is an autonumber, use Long integer as the child record's
*foreign* key.)
2. create relationship between child and parent tables.
3. create child form.
4. create parent form, and drop child form into it.
5. check the Master/Child record stuff. It should already be filled
in. If not, select the fields relating the two tables together.

And if you create a parent record, can you add a child record? You can
NOT add a child record (e.g. Invoice Line Item) without first creating
a parent record (e.g. Invoice).

Nov 13 '05 #3

martin wrote:
I was hoping to do this without sub forms as my example does. I got it working the way you described. How can I stop the record navigation bar from displaying in the sub form.

Thanks for the help.


Hmm... that's like saying "I want a relational database, but I don't
want to use relationships". Kinda defeats the whole purpose, at least
in my opinion.

Stop showing the record navigation bar? (Why?)
You could open the subform in Design mode, and set Navigation Buttons
to "Neither". Why you would is a bit of a mystery, but it's your
database. Do whatever floats your boat or meets your needs.

Nov 13 '05 #4

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

Similar topics

6
7630
by: Kenneth Osenbroch | last post by:
Hi. I want to create a trigger that only allows delete from table A if corresponding record in table B does not exist. Any idea on how this can be done? Thanks, Kenneth.
61
24395
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
1
2853
by: Brian Kedersha | last post by:
We created a XML Schema that has nested table relations. We had the following Warning message come up. An unhandled exception of the type 'System.ArgumentException' occurred in system.data.dll...
4
5990
by: Melissa | last post by:
I have a frontend file named CustomerApp and backend file named CustomerData. CustomerApp is at C:\Customer Database and CustomerData is at S:\Customer Database. Could someone help me with the code...
4
3870
by: What-a-Tool | last post by:
I am trying to write a program that will take all the members of a data base, add them to a tree, with all child relations as sub-nodes. I am having a problem getting the parent child relations...
0
1501
by: latin & geek via DotNetMonster.com | last post by:
hi! ok, im working on a database application. ive successfully managed to establish a relationship between two tables and display them on a datagrid, edit and add new records to them. now i...
4
3440
by: G .Net | last post by:
Hi I have a DataSet with several DataTables. I have set up relations between these tables. I want to delete all the tables and re-fill them. However, when I try to do so, even after using...
6
14280
by: ravichoudhari | last post by:
i came accross requirement of multiple foreign keys in a table referencing the same primary key another table. i created the table relations using the relations editor in access. even though i...
3
1634
by: Spectre1337 | last post by:
Hello, I've encountered a rather puzzling problem with SqlDataAdapter. I've set up a number of elaborate tables in the Microsoft SQL Server Management Studio Express (including several table key...
3
5441
chathura86
by: chathura86 | last post by:
hi, i have a table which has child rows in another table. Now i want to truncate this table temporally, because i will re-enter those values in a short time with some changes. cannot use update...
0
7115
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
280
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.