A
Ashish Kanoongo
I have following textboxes form
Tier1 Tier2 Tier3 (Labels)
tier1max tier2max tier3max
Fee1% Fee2% Fee3%
Following is my requirement:
In Tier Textboxes, amounts must ascend in value. Tier 1 cannot be 1,000,000 and Tier 2 500,000, for example. If a tier max amount is filled in, its associated Fee% must be filled in. Tiers must be filled in consecutively; ie. you would not have tier 1 filled in and tier 3 filled in.
Secondly suppose if you have entered value first time consecutively succesfully in (tier1max, tier2max, tier3max) 1,2,3, thne you edited record again as 4,2,3. My logic will fail in this case.
Let me know how do I this? I tried to validate on exit event, but did not able to handle it perfectly. COde are as follows
Private Sub txtTier1Max_Exit(Cancel As Integer)
If TxtTier1Max > 0 Then
If TxtTier2Max > 0 Then
If TxtTier1Max > TxtTier2Max Then
Me.TxtTier1Max.SetFocus
End If
End If
End If
If TxtTier1Max = 0 Then
txtTier1FeePerAnnum = 0
txtTier1FeePerAnnum.Enabled = False
Else
txtTier1FeePerAnnum.Enabled = True
End If
End Sub
Tier1 Tier2 Tier3 (Labels)
tier1max tier2max tier3max
Fee1% Fee2% Fee3%
Following is my requirement:
In Tier Textboxes, amounts must ascend in value. Tier 1 cannot be 1,000,000 and Tier 2 500,000, for example. If a tier max amount is filled in, its associated Fee% must be filled in. Tiers must be filled in consecutively; ie. you would not have tier 1 filled in and tier 3 filled in.
Secondly suppose if you have entered value first time consecutively succesfully in (tier1max, tier2max, tier3max) 1,2,3, thne you edited record again as 4,2,3. My logic will fail in this case.
Let me know how do I this? I tried to validate on exit event, but did not able to handle it perfectly. COde are as follows
Private Sub txtTier1Max_Exit(Cancel As Integer)
If TxtTier1Max > 0 Then
If TxtTier2Max > 0 Then
If TxtTier1Max > TxtTier2Max Then
Me.TxtTier1Max.SetFocus
End If
End If
End If
If TxtTier1Max = 0 Then
txtTier1FeePerAnnum = 0
txtTier1FeePerAnnum.Enabled = False
Else
txtTier1FeePerAnnum.Enabled = True
End If
End Sub