' Set rst = some recordset
AmountActBdgt = Amt - BAmountP
' b = ??
For i = 0 To 24
BPeriodS = "Budget_Period" & CStr(i)
BudgetFound = rst.Fields(BPeriodS).Value
If BudgetFound <> 0 And b > BudgetFound Then
BAmountNew = AmountActBdgt - BAmountS
' Exit loop.
Exit For
End If
Next i
|