【发布时间】:2020-07-13 19:43:21
【问题描述】:
我正在尝试使用表单字段来检查表列值以预限定查询以运行这是我拥有的代码,但我遇到了运行时错误。
' Set Warnings
DoCmd.SetWarnings False
If Forms!FrmCopyRoutingMenu!TextTarget = tblQuoteSection1Lines!tblQuoteMstrID Then
MsgBox ("Quote Section 1 Already Started! Please Copy Individual Sections.")
ElseIf Forms!FrmCopyRoutingMenu!TextTarget = Table!tblQuoteSection2Lines!tblQuoteMstrID Then
MsgBox ("Quote Section 2 Already Started! Please Copy Individual Sections.")
ElseIf Forms!FrmCopyRoutingMenu!TextTarget = Table!tblQuoteSection3Lines!tblQuoteMstrID Then
MsgBox ("Quote Section 3 Already Started! Please Copy Individual Sections.")
ElseIf Forms!FrmCopyRoutingMenu!TextTarget = Table!tblQuoteSection4Lines!tblQuoteMstrID Then
MsgBox ("Quote Section 4 Already Started! Please Copy Individual Sections.")
ElseIf Forms!FrmCopyRoutingMenu!TextTarget = Table!tblQuoteSection5Lines!tblQuoteMstrID Then
MsgBox ("Quote Section 5 Already Started! Please Copy Individual Sections.")
Else
【问题讨论】:
-
欢迎来到 Stack Overflow。发布您遇到的问题的错误消息是明智的。这将使用户能够确定发生了什么。
-
运行时错误 '424' 需要对象
-
我认为您不能链接到这样的表格。您将不得不使用记录集对象打开表并以这种方式获取列。
-
在不相关的说明中,您肯定不应该有 5 个表
tblQuoteSection1..5Lines,而是一个表tblQuoteSectionLines和一个部分列。这将使一切变得更容易。