I need help with some code

D

DMainland

I am trying to populate a field on a subform with information identical to
the data in a field that was previously entered on the parent form (is that
the proper terminology for the form containing the subform?). The fields are
from different tables in the database in a one to many relationship. Can
this be accomplished with a little code and, if so, where should it be
placed? Any help would be greatly appreciated.
 
J

John W. Vinson

I am trying to populate a field on a subform with information identical to
the data in a field that was previously entered on the parent form (is that
the proper terminology for the form containing the subform?). The fields are
from different tables in the database in a one to many relationship. Can
this be accomplished with a little code and, if so, where should it be
placed? Any help would be greatly appreciated.

Normally this would be done by using that field as the Subform's Master and
Child Link Field, or as one field in that property (the two properties can
consist of up to ten fieldnames separated by semicolons). What are the main
and subform's Recordsources? What is this field? Is it the linking field, or
one of the linking fields? or are you perhaps trying to store data
redundantly?
 
D

DMainland

I am trying to store redundant data in two different fields in two different
tables. Basically, I am assigning a value, 0 - 10, in a record in the
Customer table and want the value to automatically show up in a field with
the same name in a record in a Transaction table. I want the value to be a
permanent part of the transaction record. If, in the future, I change the
value in the Customer record, I want the change to be reflected in the
transaction records from that point forward. I hope I am stating the issue
clearly. Thanks for your help in this matter.
 
J

John W. Vinson

I am trying to store redundant data in two different fields in two different
tables. Basically, I am assigning a value, 0 - 10, in a record in the
Customer table and want the value to automatically show up in a field with
the same name in a record in a Transaction table. I want the value to be a
permanent part of the transaction record. If, in the future, I change the
value in the Customer record, I want the change to be reflected in the
transaction records from that point forward. I hope I am stating the issue
clearly. Thanks for your help in this matter.

In that case the field *should simply not exist* in the Transaction table.

Relational databases use the "Grandmother's Pantry Principle": "A place - ONE
place! - for everything, everything in its place". If this value depends on
the customer, and not on the transaction, it should exist in the Customer
table *AND NOPLACE ELSE*.

If you need to see it in conjunction with transaction data, use a Query
joining the custoemer table to the transaction table.
 
Top