Re: Cannot add record for child table that have relationship with master table.



Goh,

In addition to Kevin,

If your tables don't have a relation in the database than you have to add
that seperatly.

http://msdn2.microsoft.com/en-US/library/0k21zcyx.aspx

Of course have you to create the master record first before you can add any
details records.

I hope this helps,

Cor

"Goh" <goh@xxxxxxxxxxxxxxx> schreef in bericht
news:eCgihJejGHA.4972@xxxxxxxxxxxxxxxxxxxxxxx
Got a question examples the senario is like that.

if we got master and detail table.

detail table have a relationship with th master table with a primary key.

primary key is an auto number.

from my testing if master table show in "detail view" and detail table
show in "datagrid view" the add function for detail table work corrently
because of datagrid will automatic add primary key relation to the master
table primary key.

The problem come when detail table is shown in the form of "detail view"
there is no auto add primary key to detail table future. error will be
raise up, saying that primary key must be enter before add to the table.

But I can't know what is the current primary key for the master table.

And because of the master table have not update to database I also can't
get any the real primary key for the child table.

As result I can't add record for the detail table if I use "detail view"
layout How to solve this?


Please give me some advice about this.

Thanks in advance

Goh



.



Relevant Pages

  • Re: Search Form - Take 2
    ... While in Design mode, highlight all of the fields you want to include in the ... selected fields to the primary key. ... as its due to the fact that the columns in master allow Nulls. ... well enter the same 'keyword' slightly differently, ...
    (microsoft.public.access.gettingstarted)
  • Re: Search Form - Take 2
    ... selected fields to the primary key. ... description column in Recommendations or Accomplishments you'll have some ... as its due to the fact that the columns in master allow Nulls. ... well enter the same 'keyword' slightly differently, ...
    (microsoft.public.access.gettingstarted)
  • Row cannot be located for updating
    ... I have a master table and a detail table. ... (autoincrement field and primary key in MasterTable) ... with the proper ID value! ... I've just discovered that even the primary key of MasterTable ...
    (borland.public.delphi.database.ado)
  • Cannot add record for child table that have relationship with master table.
    ... detail table have a relationship with th master table with a primary key. ... in "datagrid view" the add function for detail table work corrently because ... there is no auto add primary key to detail table future. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Row cannot be located for updating
    ... Both primary keys in MasterTable and DetailTable are Autoincrement field ... But the problem seems to be on the Primary key fields, ... > The master linking field in the detail table needs to be of type Integer ...
    (borland.public.delphi.database.ado)