Access2000: Saving calculated value in form

A

Arvi Laanemets

Hi


Generally saving any calculated value into table is considered as something
to avoid, but in my case it leads to too complex calculations in contignous
form. So I prefer to save the value in table for this case.

I have:
tblLeaseContracts: ContractID, ContractDate, ....
tblDeviceContracts:ID (autonumber), DeviceID, ContractID, ContractDate, ....

I have a form, where device is selected. This form has a subform
fmDeviceContracts with tblDeviceContracts as source, where user can select a
contract (control cbbContractID, field ContractID) to link the device
selected in parent from with it. ContractID is selected from
tblLeaseContracts. I want to save ContractDate along with ContractID too.

What is the simplest and foolproofest way to save ContractDate in
tblDeviceContracts (so that I'll not have a lot of half-empty rows in table
as result of occassional new entries)?


Thanks in advance!
 
D

Douglas J. Steele

Don't use tblDeviceContracts as the source for the subform.

Create a query that joins the two tables, and use the query as the source.
 

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