Copy from one subform to another record

G

Guest

I hope someone can help. I have a main form (Contracts) with 2 subforms, data stores in tblContracts and tblContractDetails. App Contracts are entered first, with a Contract# (like App04111), App/Merch, StartDate, EndDate, CorrespContract#(empty here), NumOfWidgets (and others) in the main Contracts section, then enters a list of StoreID's and AppDate's in the AppSub form. On Contracts form, when user chooses App or Merch either the AppSub becomes visible or the MerchSub; they cannot store App and Merch on the same contract

Only sometimes is there a corresponding Merch contract. When there is, when user enters CorrespContract# (App04111) I want it to copy just these fields from the original AppContract, and the StoreID and AppDate list to the MerchSub

I cannot seem to get these fields correct, and would appreciate any help. Thanks!
 
M

Michel Walsh

Hi,


There is generally no need to store repeated data (there are exceptions,
like for archives), and, in fact, it can become troubles, mainly if you have
to update one record, you can't, since you have to update all the other
records too into which you "copied" the data (like a cut-and-paste of some
lines of code, if you find an error in the original lines, you have to
remember every occurrence where you did cut-and-paste it, to repair the
error there too). Can't you change the table design to avoid that? A simple
inner join between tables can "retrieve" the "repeated" data at "run time",
as required, without having really stored the same data at many places. Much
less simple for maintenance... and to append new data, as you discovered.



Hoping it may help,
Vanderghast, Access MVP

Cat said:
I hope someone can help. I have a main form (Contracts) with 2 subforms,
data stores in tblContracts and tblContractDetails. App Contracts are
entered first, with a Contract# (like App04111), App/Merch, StartDate,
EndDate, CorrespContract#(empty here), NumOfWidgets (and others) in the main
Contracts section, then enters a list of StoreID's and AppDate's in the
AppSub form. On Contracts form, when user chooses App or Merch either the
AppSub becomes visible or the MerchSub; they cannot store App and Merch on
the same contract.
Only sometimes is there a corresponding Merch contract. When there is,
when user enters CorrespContract# (App04111) I want it to copy just these
fields from the original AppContract, and the StoreID and AppDate list to
the MerchSub.
I cannot seem to get these fields correct, and would appreciate any help.
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