473,614 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
+ 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 1477

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********@hot mail.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.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
7641
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
24451
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 'stretch'</td> <td valign="top" width="300">some data that won't 'stetch'</td> </tr> </table>
1
2865
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 Additional information: The same Table (DOS_Identifiers) cannot be the child table in two nested relations. Does anyone know a workaround for this problem? You are suppose to be able
4
6003
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 to do the following: 1. Create a new table named TblCustomerContact in CustomerData 2. Add a field named CustomerContactID (autonumber) in TblCustomerContact 3. Add a field named CustomerID (Number-Long) in TblCustomerContact 4. Add a field...
4
3882
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 for each table & query. Dim tblCurrent As DataTable Dim strTableName As string For Each tblCurrent In Ds1.Tables
0
1509
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 need to generate a report using the parameters in the child table, and two columns from the parent table. this is where the problem starts. when i use two seperate connection links and extract the required data, adding it all to the same dataset,...
4
3460
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 Relations.Clear() I still get excecptions, such as: Cannot remove ForeignKeyConstraint - remove the constraint first
6
14289
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 could have multiple foreign keys to a table access did allow the referential integrity. my database structure is table1 - students table table 2 - subjects table
3
1642
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 relationships), and I've been successfully accessing all of that information through the classes generated by the "visual" DataSet file in Web Developer Express (Solution > Add New Item > Data Set). Prior to my last code modification I've...
3
5455
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 statement to make those changes. only possible way is truncating and inserting. also i want to insert some data in to child rows without any parent rows. as in the previous section i can add the relevant parent rows shortly. its like i want to...
0
8130
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8627
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8579
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8279
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8433
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6088
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5540
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1425
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.