Form/Subform

  • Thread starter Fathi via AccessMonster.com
  • Start date
F

Fathi via AccessMonster.com

I have form and subform both working fine,

i just discovered that when i add a new item in the header, the detail
"subform" populate the values automatically, but when i retrieve the record
in order to change the invoice number which the key between both forms , it
does not update in the subform... and i loose the information once updated in
the main form.. so how can i prevent it?


any idea thanks!
 
B

Beetle

If you go back and manually change the Primary Key value of an existing
record in the master form, the child record in the subform *will not* be
automatically updated. You will therefore have orphaned records in the
child table.

How do you prevent it? Stop changing the PK value of existing records. If
your invoice numbers are an attribute that must be changed from time to
time, then you should not be using it as your PK. Use a surrogate PK that
will never need to be changed. PK's are "not for human consumption"
as they say.
 
F

fathi_abuayyash via AccessMonster.com

Thnaks!
but i am doing so becuse of human errors that may happen.. the invoice number
must not change , i agree with u.

any way thanks! i will keep it as is..

If you go back and manually change the Primary Key value of an existing
record in the master form, the child record in the subform *will not* be
automatically updated. You will therefore have orphaned records in the
child table.

How do you prevent it? Stop changing the PK value of existing records. If
your invoice numbers are an attribute that must be changed from time to
time, then you should not be using it as your PK. Use a surrogate PK that
will never need to be changed. PK's are "not for human consumption"
as they say.
I have form and subform both working fine,
[quoted text clipped - 5 lines]
any idea thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top