Dim nod As Currency Dim agi As Currency Private Sub analyze_Click() lstatus.Caption = tstatus.Text nod = Val(tnodep.Text) agi = Val(tagi.Text) lagi.Caption = Format$(agi, "#,###,###.00") checkstatus Frame1.Enabled = False clear.Enabled = True analyze.Enabled = False End Sub Private Sub clear_Click() Frame1.Enabled = True tstatus.Text = "" tnodep.Text = "" tagi.Text = "" lstatus.Caption = "" lnodep.Caption = "" lagi.Caption = "" lpersonal.Caption = "" ladditional.Caption = "" lexemption.Caption = "" lti.Caption = "" analyze.Enabled = True clear.Enabled = False tstatus.SetFocus End Sub Private Sub close_Click() End End Sub Private Sub tnodep_Change() If Val(tnodep.Text) >= 1 Then tagi.SetFocus End If End Sub Private Sub tstatus_Click() If tstatus.Text = "Single" Or tstatus.Text = "Widowed" Then tagi.SetFocus tnodep.Enabled = False Else
tnodep.Enabled = True tnodep.SetFocus End If End Sub Sub checkstatus() If tstatus.Text = "Single" Then lpersonal.Caption = Format$(25000, "#,###,###.00") ladditional.Caption = Format$(0, "#,###,###.00") lexemption.Caption = Format$(25000, "#,###,###.00") lti.Caption = Format$(agi - 25000, "#,###,###.00") ElseIf tstatus.Text = "Widowed" Then lpersonal.Caption = Format$(30000, "#,###,###.00") ladditional.Caption = Format$(3500, "#,###,###.00") lexemption.Caption = Format$(33500, "#,###,###.00") lti.Caption = Format$(agi - 33500, "#,###,###.00") Else lnodep.Caption = tnodep.Text lpersonal.Caption = Format$(35000, "#,###,###.00") marriedAexemption lexemption.Caption = Format$(CCur(lpersonal.Caption) + CCur(ladditional.Caption), "#,###,###.00") lti.Caption = Format$(agi - CCur(lexemption.Caption), "#,###,###.00") End If End Sub Sub marriedAexemption() If nod = 1 Then ladditional.Caption = Format$(5000, "#,###,###.00") ElseIf nod = 2 Then ladditional.Caption = Format$(10000, "#,###,###.00") ElseIf nod = 3 Then ladditional.Caption = Format$(15000, "#,###,###.00") ElseIf nod >= 4 Then ladditional.Caption = Format$(20000, "#,###,###.00") End If End Sub