S
Stapes
Hi
I have a couple of calculated controls on a subform. I put the
calculations for them in the On Current event of the subform: -
Dim MyJobTime As Variant
MyJobTime = Calculate_JobTime / 2
Debug.Print MyJobTime
[Forms]![FM_MainDetails]![FMS_Boat_subform]!
[TM_JobDetails_subform].Form![NUM_JobTime] = MyJobTime
[Forms]![FM_MainDetails]![FMS_Boat_subform]!
[TM_JobDetails_subform].Form![CUR_Labour] = _
MyJobTime * [Forms]![FM_MainDetails]![FMS_Boat_subform]!
[TM_JobDetails_subform].Form![Labour_Rate]
Dim MyPartsTotal As Variant
MyPartsTotal = Calculate_PartsTotal
[Forms]![FM_MainDetails]![FMS_Boat_subform]!
[TM_JobDetails_subform].Form![Total_Parts] = MyPartsTotal
Trouble is, where no records exist, it calculates these controls &
places the values in the appropriate fields, thereby creating a new &
unwanted record.
Is there anywhere I can put this code where it will execute only when
a record exists?
Stapes
I have a couple of calculated controls on a subform. I put the
calculations for them in the On Current event of the subform: -
Dim MyJobTime As Variant
MyJobTime = Calculate_JobTime / 2
Debug.Print MyJobTime
[Forms]![FM_MainDetails]![FMS_Boat_subform]!
[TM_JobDetails_subform].Form![NUM_JobTime] = MyJobTime
[Forms]![FM_MainDetails]![FMS_Boat_subform]!
[TM_JobDetails_subform].Form![CUR_Labour] = _
MyJobTime * [Forms]![FM_MainDetails]![FMS_Boat_subform]!
[TM_JobDetails_subform].Form![Labour_Rate]
Dim MyPartsTotal As Variant
MyPartsTotal = Calculate_PartsTotal
[Forms]![FM_MainDetails]![FMS_Boat_subform]!
[TM_JobDetails_subform].Form![Total_Parts] = MyPartsTotal
Trouble is, where no records exist, it calculates these controls &
places the values in the appropriate fields, thereby creating a new &
unwanted record.
Is there anywhere I can put this code where it will execute only when
a record exists?
Stapes