我在一个窗体中关联了一个表,里面有”利率浮动方式 “和”浮动比例“,在另一张表中有基准利率,贷款执行率为:1+(—)浮动比例*基准利率。
我写的代码如下
Dim term As Integer
Dim rate As Single
If [利率浮动方向] = "上调" Then
rate = 1 + [利率浮动比例]
Else
rate = 1 - [利率浮动比例]
End If
term = [借款期限]
If [利率调整类型] = "先固定后浮动利率(中长期贷款)" Or [利率调整类型] = "全程固定利率(中长期贷款)" Then
[执行利率].Value = [固定利率值]
Else
Select Case term
Case term <= 6
[执行利率].Value = [Forms]![利率表]![b1a] * rate
Case term > 6 And term <= 12
[执行利率].Value = [Forms]![利率表]![b1b] * rate
Case term > 12 And term <= 36
[执行利率].Value = [Forms]![利率表]![b1c] * rate
Case term > 36 And term <= 60
[执行利率].Value = [Forms]![利率表]![b1d] * rate
Case term > 60
[执行利率].Value = [Forms]![利率表]![b1e] * rate
End Select
End If