how to update ALL child records

E

E. Kwong

I have a date field on a Access form. Users are allowed to change the date
as long as it's a date in the future. I would like to propagate the new
date to all the child records. The date in the child records should carry
the new date (while the time portion should remain unchanged).

Should I do the update in the Change event of the date, or should I write a
separate script to do that?

Thanks for any advice.

I'm using Access 2003 as frontend and SQL server as backend. The field in
question is of datetime data type.
 
K

Ken Sheridan

Don't store the date in the referencing (child) table as well as in the
referenced table as this introduces redundancy and the possibility of
inconsistent data. Instead store the time value only in the referencing
table. In a query or computed control in a form or report, you can simply
combine the 'date' in the referenced table with the 'time' in the referencing
table to get the 'child date/time'.

Ken Sheridan
Stafford, England
 
A

Arvin Meyer [MVP]

It depends upon how the child records are being displayed (or not displayed)

If it's a bound subform, I'd build a recordset based upon the subform's
recordsetclone.

Other wise, I'd use the form's ID (or whatever your Primary Key is called)
to build a recordset on the Foreign Key of the child table.
 

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