Form/Subform Problems

Keith

Registered User.
Local time
Today, 10:42
Joined
May 21, 2000
Messages
129
I have a form [FrmBooking] that has an unbound text box [Total] that calculates a total price from several fields on the main form.
I have a subform [FrmTrans] and I wish to transfer the contents of [Total] to a subform field [SellPrice] Try as I might I can't make it work. I can get data from bound fields to copy across but not from unbound ones.
Help please I'm going Grey.
Keith
 
Try setting the value of the target field in the AfterUpdate of the source field. This could be done with a direct reference to the field value {ie Forms!FormName!SubFormName!TargetFieldName = Me.SourceFieldName}
or by reproducing the caluclation that gave the source field it's value {ie Forms!FormName!SubFormName!TargetFieldName = (me.price -(me.price * me.discount)) * me.ordered }
Good Luck
Chris
 
Chris I have tried both your suggestions without any luck.
Thanks anyway
Keith
 
Keith,
First, calculated amounts should usually not be stored - so make sure you have a very good reason for storing this data.

Second, there is something wrong with the logic of what you are trying to do. If all the data being used to calculate SellPrice is from the Booking table, then the calculated result should be stored in the Bookings table rather than the Trans table. It does not make any sense to store the same piece of information multiple times (especially when you probably should not be storing it at all). If the calculation uses fields from both tables, then do the calculation in the sub-form in its BeforeUpdate event.
 

Users who are viewing this thread

Back
Top Bottom