I have created a new contract data entry form. An early part of the form's data entry handles tiered pricing selection. I used check boxes for this area. The result of clicking a check box (among other things) is that it populates 12 text fields with monthly minimum billing amounts (Ex., If I select the checkbox that identifies the base list pricing the 12 monthly minimum billing amount fields will all populate with $250.00.) The text box names for these 12 minimum Billing Amount fields are as follows: "Mo1MinCom", "Mo2MinCom", etc through "Mo12MinCom"
That After Update VBA on the list pricing check box is as follows:
Private Sub CHKListPrice_AfterUpdate()
If Me.CHKListPrice = True Then
Me.CHKTier1.Value = False
Me.CHKTier2.Value = False
Me.CHKTier3.Value = False
Me.CHKTier4.Value = False
Me.Mo1MinCom = Me.TXTBase_Price_Min
Me.Mo2MinCom = Me.TXTBase_Price_Min
Me.Mo3MinCom = Me.TXTBase_Price_Min
Me.Mo4MinCom = Me.TXTBase_Price_Min
Me.Mo5MinCom = Me.TXTBase_Price_Min
Me.Mo6MinCom = Me.TXTBase_Price_Min
Me.Mo7MinCom = Me.TXTBase_Price_Min
Me.Mo8MinCom = Me.TXTBase_Price_Min
Me.Mo9MinCom = Me.TXTBase_Price_Min
Me.Mo10MinCom = Me.TXTBase_Price_Min
Me.Mo11MinCom = Me.TXTBase_Price_Min
Me.Mo12MinCom = Me.TXTBase_Price_Min
Else
Me.Mo1MinCom = ""
Me.Mo2MinCom = ""
Me.Mo3MinCom = ""
Me.Mo4MinCom = ""
Me.Mo5MinCom = ""
Me.Mo6MinCom = ""
Me.Mo7MinCom = ""
Me.Mo8MinCom = ""
Me.Mo9MinCom = ""
Me.Mo10MinCom = ""
Me.Mo11MinCom = ""
Me.Mo12MinCom = ""
End If
If Me.CHKListPrice = False Then
If Me.CHKTier1.Value = False Then
If Me.CHKTier2.Value = False Then
If Me.CHKTier3.Value = False Then
If Me.CHKTier4.Value = False Then
Me.CHKListPrice.Value = True
End If
End If
End If
End If
End If
End Sub
Later in the form, I provide combo boxes (One for each of the 12 months of the contract) that allow for overriding the monthly minimum billing amount fields. There are three options within the combo box ("Minimum Commit", "Usage Based" and "Zero Charge"). Depending on the option selected, the monthly minimum billing amount stays as previously assigned (If "MinimumCommit" is selected) or re-sets the billing amount for that month to $0 if either "Usage Based" or "Zero Charge" is selected. That After Update VBA is as follows for the Month One combo box:
Private Sub CBOMinOptionMo1_AfterUpdate()
Me.TXTMinOptionMo1 = Me.CBOMinOptionMo1
Me.CBOMinOptionMo1.BackColor = RGB(214, 220, 229)
Me.Mo1MinCom.BackColor = RGB(214, 220, 229)
If Me.CBOMinOptionMo1 = "Minimum Commit" Then
Me.Mo1MinCom = Me.TXTBase_Price_Min
ElseIf Me.CBOMinOptionMo1 = "Usage Based" Then
Me.Mo1MinCom = 0
ElseIf Me.CBOMinOptionMo1 = "Zero Charge" Then
Me.Mo1MinCom = 0
End If
End Sub
It actually works...to a degree. It is successfully changing the "Mo1MinCom" text field to $0 or leaving at the previously assigned tiered pricing amount based on the combo box selection. The problem is it is also changing the other 11 monthly minimum billing amounts ("Mo2MinCom", "Mo3MinCom", etc through "Mo12MinCom") when I wanted each combo box selection only to change the related text box.
Thanks for any help!
That After Update VBA on the list pricing check box is as follows:
Private Sub CHKListPrice_AfterUpdate()
If Me.CHKListPrice = True Then
Me.CHKTier1.Value = False
Me.CHKTier2.Value = False
Me.CHKTier3.Value = False
Me.CHKTier4.Value = False
Me.Mo1MinCom = Me.TXTBase_Price_Min
Me.Mo2MinCom = Me.TXTBase_Price_Min
Me.Mo3MinCom = Me.TXTBase_Price_Min
Me.Mo4MinCom = Me.TXTBase_Price_Min
Me.Mo5MinCom = Me.TXTBase_Price_Min
Me.Mo6MinCom = Me.TXTBase_Price_Min
Me.Mo7MinCom = Me.TXTBase_Price_Min
Me.Mo8MinCom = Me.TXTBase_Price_Min
Me.Mo9MinCom = Me.TXTBase_Price_Min
Me.Mo10MinCom = Me.TXTBase_Price_Min
Me.Mo11MinCom = Me.TXTBase_Price_Min
Me.Mo12MinCom = Me.TXTBase_Price_Min
Else
Me.Mo1MinCom = ""
Me.Mo2MinCom = ""
Me.Mo3MinCom = ""
Me.Mo4MinCom = ""
Me.Mo5MinCom = ""
Me.Mo6MinCom = ""
Me.Mo7MinCom = ""
Me.Mo8MinCom = ""
Me.Mo9MinCom = ""
Me.Mo10MinCom = ""
Me.Mo11MinCom = ""
Me.Mo12MinCom = ""
End If
If Me.CHKListPrice = False Then
If Me.CHKTier1.Value = False Then
If Me.CHKTier2.Value = False Then
If Me.CHKTier3.Value = False Then
If Me.CHKTier4.Value = False Then
Me.CHKListPrice.Value = True
End If
End If
End If
End If
End If
End Sub
Later in the form, I provide combo boxes (One for each of the 12 months of the contract) that allow for overriding the monthly minimum billing amount fields. There are three options within the combo box ("Minimum Commit", "Usage Based" and "Zero Charge"). Depending on the option selected, the monthly minimum billing amount stays as previously assigned (If "MinimumCommit" is selected) or re-sets the billing amount for that month to $0 if either "Usage Based" or "Zero Charge" is selected. That After Update VBA is as follows for the Month One combo box:
Private Sub CBOMinOptionMo1_AfterUpdate()
Me.TXTMinOptionMo1 = Me.CBOMinOptionMo1
Me.CBOMinOptionMo1.BackColor = RGB(214, 220, 229)
Me.Mo1MinCom.BackColor = RGB(214, 220, 229)
If Me.CBOMinOptionMo1 = "Minimum Commit" Then
Me.Mo1MinCom = Me.TXTBase_Price_Min
ElseIf Me.CBOMinOptionMo1 = "Usage Based" Then
Me.Mo1MinCom = 0
ElseIf Me.CBOMinOptionMo1 = "Zero Charge" Then
Me.Mo1MinCom = 0
End If
End Sub
It actually works...to a degree. It is successfully changing the "Mo1MinCom" text field to $0 or leaving at the previously assigned tiered pricing amount based on the combo box selection. The problem is it is also changing the other 11 monthly minimum billing amounts ("Mo2MinCom", "Mo3MinCom", etc through "Mo12MinCom") when I wanted each combo box selection only to change the related text box.
Thanks for any help!