没细看,试试下面的代码:
KindCode = Left(TypeCode, 3)
Set Conn = CurrentProject.Connection
Select Case KindCode
Case "IIS"
CityCode = DLookup("[IIS_CityCode]", "da_JBXX", "[EmployeeID]= " & EmployeeID & "")
strSQL = "SELECT * FROM IIS_N WHERE IIS_N.CityCode='" & CityCode & "' AND left(IIS_N.TypeCode,3)='" & TypeCode & "' and ((IIS_N.Offer)=True)"
Rec.Open strSQL, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
Do While Not Rec.EOF
Offer = Rec.Fields("Offer")
If Offer = False Then
P = 0
C = O
Exit Sub
End If
If TypeCode = "IISZ" Then
P_value = Rec.Fields("Value_P")
C_value = Rec.Fields("Value_C")
P = P_value
C = C_value
Else
P_rate = Rec.Fields("Rate_P")
C_rate = Rec.Fields("Rate_C")
BS = BaseMoney(CityCode, KindCode, Base)
P = BS * P_rate
C = BS * C_rate
End If
Rec.MoveNext
Loop
[此贴子已经被作者于2006-5-14 0:24:17编辑过]
|