R
ryan.fitzpatrick3
I have a text box that does a calculation of several text boxes to
give me a delivered price per case. I have an option group with 3
selection check boxes with three text boxes next to it where I input
freight weight. Check box 1 has text box 1 where I enter in full truck
weight, cbox 2 has tbox 2 where I enter in 1/2 truck weight, and 1/3
truck weight for the 3rd cbox and tbox respectively. Make sense thus
far. Now in the summed text box I would like it to calculate which one
of the three weights, full, half or third to use by whichever check
box is clicked. I have this code, but I'm not sure it it's correct.
Check 1 = check52
Check 2 = check54
Check 3 = check56
Private Sub OptGroupFreight_click()
Select Case OptGroupFreight
Case 1
If Check52.Enabled = True Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeightFull] * Forms!Supplier!
Component.Form!CaseWeight), 0)
If Check54.Enabled = False Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeighthalf] * Forms!Supplier!
Component.Form!CaseWeight), 0)
If Check56.Enabled = False Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeightthird] * Forms!Supplier!
Component.Form!CaseWeight), 0)
Case 2
If Check54.Enabled = True Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeighthalf] * Forms!Supplier!
Component.Form!CaseWeight), 0)
If Check52.Enabled = False Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeightFull] * Forms!Supplier!
Component.Form!CaseWeight), 0)
If Check56.Enabled = False Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeightthird] * Forms!Supplier!
Component.Form!CaseWeight), 0)
Case 3
If Check56.Enabled = True Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeightthird] * Forms!Supplier!
Component.Form!CaseWeight), 0)
If Check54.Enabled = False Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeighthalf] * Forms!Supplier!
Component.Form!CaseWeight), 0)
If Check52.Enabled = False Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeightFull] * Forms!Supplier!
Component.Form!CaseWeight), 0)
End Select
End Sub
Any ideas?
Thanks,
Ryan
give me a delivered price per case. I have an option group with 3
selection check boxes with three text boxes next to it where I input
freight weight. Check box 1 has text box 1 where I enter in full truck
weight, cbox 2 has tbox 2 where I enter in 1/2 truck weight, and 1/3
truck weight for the 3rd cbox and tbox respectively. Make sense thus
far. Now in the summed text box I would like it to calculate which one
of the three weights, full, half or third to use by whichever check
box is clicked. I have this code, but I'm not sure it it's correct.
Check 1 = check52
Check 2 = check54
Check 3 = check56
Private Sub OptGroupFreight_click()
Select Case OptGroupFreight
Case 1
If Check52.Enabled = True Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeightFull] * Forms!Supplier!
Component.Form!CaseWeight), 0)
If Check54.Enabled = False Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeighthalf] * Forms!Supplier!
Component.Form!CaseWeight), 0)
If Check56.Enabled = False Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeightthird] * Forms!Supplier!
Component.Form!CaseWeight), 0)
Case 2
If Check54.Enabled = True Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeighthalf] * Forms!Supplier!
Component.Form!CaseWeight), 0)
If Check52.Enabled = False Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeightFull] * Forms!Supplier!
Component.Form!CaseWeight), 0)
If Check56.Enabled = False Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeightthird] * Forms!Supplier!
Component.Form!CaseWeight), 0)
Case 3
If Check56.Enabled = True Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeightthird] * Forms!Supplier!
Component.Form!CaseWeight), 0)
If Check54.Enabled = False Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeighthalf] * Forms!Supplier!
Component.Form!CaseWeight), 0)
If Check52.Enabled = False Then [CasePrice] =
Nz(([FreightTotalDelCosts] / [TruckWeightFull] * Forms!Supplier!
Component.Form!CaseWeight), 0)
End Select
End Sub
Any ideas?
Thanks,
Ryan