0
私は完全にコーディングするのが初めてです。私は、ボタンをクリックしてアクセスするイベントプロシージャを作成しようとしていますが、それぞれ独立して変数があり、なぜプロセスが失敗しているのかわかりません。私は、イベントプロシージャが縛られているAccessの計算ボックスをクリックすると、エラーも表示されません。ここまで私がこれまで持っていたことがあります。そして、このような全てのコードブロック修正VB.netアクセスの電卓
Dim GrandTotalIncome As Currency
Dim Factor As Currency
:
オプションは、最初のデータベース
Private Sub CalculateButton_Click()
Dim TotalIncomeAmt As Integer
Dim TotalSocialSecurityIncomeAmt As Integer
Dim TotalSocialSecurityBenefitAmt As Integer
Dim TotalChildSupportAmt As Integer
Dim TotalFoodStampAmt As Integer
Dim TotalOtherIncomeAmt As Integer
Dim GrandTotalIncome As Integer
If IFW - How_often_received = "Weekly" Then
TotalIncomeAmt = IFW_Amount * 4.25
End If
If IFW - How_often_received = "Bi-Monthly" Then
TotalIncomeAmt = IFW_Amount * 2
End If
If IFW - How_often_received = "Monthly" Then
TotalIncomeAmt = IFW_Amount
End If
If IFW - How_often_received = " " Then
TotalIncomeAmt = 0
End If
If SSI - How_often_received = "Weekly" Then
TotalSocialSecurityIncomeAmt = SSI_Amount * 4.25
End If
If SSI - How_often_received = "Bi-Monthly" Then
TotalSocialSecurityIncomeAmt = SSI_Amount * 2
End If
If SSI - How_often_received = "Monthly" Then
TotalSocialSecurityIncomeAmt = SSI_Amount
End If
If SSI - How_often_received = " " Then
TotalSocialSecurityIncomeAmt = 0
End If
If SSB - How_often_received = "Weekly" Then
TotalSocialSecurityBenefitAmt = SSB_Amount * 4.25
End If
If SSI - How_often_received = "Bi-Monthly" Then
TotalSocialSecurityBenefitAmt = SSB_Amount * 2
End If
If SSI - How_often_received = "Monthly" Then
TotalSocialSecurityBenefitAmt = SSB_Amount
End If
If SSI - How_often_received = " " Then
TotalSocialSecurityBenefitAmt = 0
End If
If CH - How_often_received = "Weekly" Then
TotalChildSupportAmt = CH_Amount * 4.25
End If
If CH - How_often_received = "Bi-Monthly" Then
TotalChildSupportAmt = CH_Amount * 2
End If
If CH - How_often_received = "Monthly" Then
TotalChildSupportAmt = CH_Amount
End If
If CH - How_often_receive_benefits = " " Then
TotalChildSupportAmt = 0
End If
If FS - How_often_received = "Weekly" Then
TotalFoodStampAmt = FS_Dollar_Amount * 4.25
End If
If FS - How_often_received = "Bi-Monthly" Then
TotalFoodStampAmt = FS_Dollar_Amount * 2
End If
If FS - How_often_received = "Monthly" Then
TotalFoodStampAmt = FS_Dollar_Amount
End If
If FS - How_often_received = " " Then
TotalFoodStampAmt = 0
End If
If OI - How_often_received = "Weekly" Then
TotalOtherIncomeAmt = OI_Amount * 4.25
End If
If OI - How_often_received = "Bi-Monthly" Then
TotalOtherIncomeAmt = OI_Amount * 2
End If
If OI - How_often_received = "Monthly" Then
TotalOtherIncomeAmt = OI_Amount
End If
If OI - How_often_received = "None" Then
TotalOtherIncomeAmt = 0
End If
GrandTotalIncome = (TotalIncomeAmt + TotalBenefitsAmt + TotalFoodStampAmt + TotalChildSupportAmt + TotalOtherIncomeAmt)
Total_Monthly_Income = GrandTotalIncome
End Sub
は毎週の計算が 'で行われるべきではありません0.25' ? –
これは、 'IFW - How_often_received =" Weekly "'を意味しますか?私が読んだのは、How_often_receivedからのSubstract IFWで、その結果を 'Weekly'という文字列と比較することです。これは私には意味がありません。あなたはこれをどこにでも持っています。 –
@ThomasGが指摘したことは、再訪する必要があるとして最初に現れたことでした。もう一度考え直すことは、複数の条件が成り立つ可能性があることです。その場合、変更したい: 'TotalIncomeAmt = IFW_Amount * 4.25'から' TotalIncomeAmt = TotalIncomeAmt +(IFW_Amount * 4.25) ' –