问题描述
Option Compare Database
Option Explicit
Public Function Day1DU(InvFullBP As Single) As Single
Dim Current_Frm As Form
Set Current_Frm = Screen.ActiveForm
Dim CalcDuAdjs As Double,HBCO As Double,HBP As Double,AMRF As Double
只有我第二次发帖,所以请保持友好。 我需要查看SoldInfo_Tbl的FundDate字段中是否有值。如果该字段为空白,则我们需要假设9/1/2020。如果不为null,则它必须大于8/31/2020才能运行代码。 我从来没有这样寻找价值。我一直提到当前表格。 DAO.Database出现问题
不良市场融资费
Dim dbMyDB As DAO.Database
Dim tblSoldInfo As DAO.TableDef
Dim fldMyField As DAO.Field
Dim rs As DAO.Recordset
Set dbMyDB = CurrentDb
Set tblSoldInfo = dbMyDB![SoldInfo_Tbl]
Set fldMyField = tblSoldInfo![FundDate]
Set rs = CurrentDb.OpenRecordset("SoldInfo_Tbl",dbOpenTable)
不良市场融资费
Select Case Val(Current_Frm!InvestorID_Cbo.Column(0))
Case 2,4,15
If Current_Frm!RateSheetDate_Txt > #8/12/2020# Then
If Current_Frm!LoanType_Cbo <> "PURCHASE" And (Current_Frm!Plan_Cbo = "10" Or Current_Frm!Plan_Cbo = "20" Or Current_Frm!Plan_Cbo = "11" Or Current_Frm!Plan_Cbo = "55" Or Current_Frm!Plan_Cbo = "71" Or Current_Frm!Plan_Cbo = "101" Or Current_Frm!Plan_Cbo = "12" Or Current_Frm!Plan_Cbo = "10H" Or Current_Frm!Plan_Cbo = "20H" Or Current_Frm!Plan_Cbo = "55H" Or Current_Frm!Plan_Cbo = "71H" Or Current_Frm!Plan_Cbo = "101H" Or Current_Frm!Plan_Cbo = "11H" Or Current_Frm!Plan_Cbo = "12H") Then
AMRF = 0.5
Else
AMRF = 0
End If
End If
Case 16,17
下面我的问题vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
If Nz(rs![tblSoldInfo]![fldMyField],#9/1/2020#) > #8/31/2020# Then
If Current_Frm!LoanType_Cbo <> "PURCHASE" And (Current_Frm!Plan_Cbo = "10" Or Current_Frm!Plan_Cbo = "20" Or Current_Frm!Plan_Cbo = "11" Or Current_Frm!Plan_Cbo = "12" Or Current_Frm!Plan_Cbo = "10H" Or Current_Frm!Plan_Cbo = "20H" Or Current_Frm!Plan_Cbo = "11H" Or Current_Frm!Plan_Cbo = "12H") Then
AMRF = 0.5
Else
AMRF = 0
End If
End If
End Select
结束不良市场再融资费用
解决方法
我终于明白了。我有一个拆分的ms-access数据库。如果拆分数据库,则表不是本地的,并且我无法使用OpenRecordset(“ SoldInfo_Tbl”, dbOpenTable ),我必须使用 dbOpenDynaset 。