copy fields

  • Thread starter Thread starter Darryl
  • Start date Start date
D

Darryl

Greetings,
I have a database that has two tables.
Members, and Transactions. The relationship is 1 to many.

I have created a Main form that shows member records one
at a time. I have a subform that shows the transactions for
just that member.

When the user clicks for a new transaction record and enters
some info, I want to fill some of the member record info into the
transaction
record (I know it is redundant, but I am doing this for a very specific
purpose).

How would I fill those fields in when the user clicks the save ?
 
When you create a new member record, there are no transaction records. Are
you saying you always want one transaction record set up? How do you propose
to get the information to transfer on subsequent new transaction records, or
is this not needed? Ideally, the information should transfer whenever you
create a new transaction record - which would be done in the subform.

Dorian
 
Greetings,
I have a database that has two tables.
Members, and Transactions. The relationship is 1 to many.

I have created a Main form that shows member records one
at a time. I have a subform that shows the transactions for
just that member.

When the user clicks for a new transaction record and enters
some info, I want to fill some of the member record info into the
transaction
record (I know it is redundant, but I am doing this for a very specific
purpose).

How would I fill those fields in when the user clicks the save ?

How many fields are you talking about, and what information are you
trying to store? Are you ABSOLUTELY CERTAIN that this information must
be stored redundantly, recognizing the very real risk of update
anomalies (i.e. the "same" field in the two tables coming to have
different values)?

You could use the subform's BeforeUpdate event:

Private Sub Form_BeforeUpdate(Cancel as Integer)
Me!txtThisField = Parent!txtThisField
Me!txtThatField = Parent!txtThatField
<etc>

John W. Vinson[MVP]
 
Yes, I need it. Here is the scenario.

I have a member list that is imported from Excel to a table in my database.
Whenever
a new list is generated, the old one is purged from the member table.
Although the
member table is purged, the transactions for each member are retained for
statistics and
reference. In addition, the new imported member list will have new members
and old members,
but their id is changed each time. So this import their id may be joe1234
and the next list it
might be 12739. Member joe is not guaranteed to have the same id list to
list.

So, when I create a transaction for member joe, I want to save some of the
info from their member
record into the transaction record. I realize it is redundant, but I want
to preserve some of the member
record info.

thanks,
Darryl
 
Back
Top