MS Access子表单,表单视图中带有#Error的字段 [英] MS Access Subform with fields with #Error in form view
问题描述
MS Access 2003.
MS Access 2003.
我在一个子窗体的后面有一个查询,该子窗体具有这样的sql语句:
I have a query behind a subform that has a sql statement like this:
SELECT ClientTotalInvoiceLineItems.*
, CDate(GetWeekEnding([WeekEnding1],[WeekEnding2],[WeekEnding3],[WeekEnding4],[WeekEnding5],[WeekEnding6])) AS WeekEnding
, CapturedInvoices.EnteredInvoiceNo, IIf([forms]![frmClientTotalInvoices]![frmClientTotalInvoicesSub].[Form].[NewRecord]=True,0,Ccur([ContractingFeesSubtotal])) AS Subtotal
, CCur([GSTAmount]) AS GST, CCur([TotalDue]) AS Total
, IIf(IsNull([ctlCreated]),'',[ctlCreated] & ' by ' & [ctlCreatedBy]) AS Added
FROM ClientTotalInvoiceLineItems
INNER JOIN CapturedInvoices
ON ClientTotalInvoiceLineItems.ctlSourceID = CapturedInvoices.CapturedInvoicedID
ORDER BY CDate(GetWeekEnding([WeekEnding1],[WeekEnding2],[WeekEnding3],[WeekEnding4],[WeekEnding5],[WeekEnding6])) DESC;
当表单处于新记录中时,我在以ccur开头的字段中遇到#error.
When the form is on a new record I get #error in the fields starting with ccur.
因此,您可以看到我尝试在字段上放置Form.NewRecord表达式以对其进行测试,但是现在当我尝试在窗体视图中查看时,MSAccess崩溃.
So as you can see I tried to put a Form.NewRecord expression on field to test it but now MSAccess crashes when I try view in form view.
如何消除子窗体新记录中字段中的那些#error?
How can I get rid of those #error in the fields on a new record of a subform??
马尔科姆
推荐答案
我知道一个可能的错误是您没有正确嵌套表格;
I know one possible error is that you haven't correctly nested the forms;
它所处的主要容器"形式需要包含在语句中,例如
The main "container" form that it's on needs to be included in the statement like
[forms]![frmClientTotalInvoices]![frmClientTotalInvoicesSub].[Form].[NewRecord]
我假设frmClientTotalInvoices
是表单中最大的容器.
I'm assuming that frmClientTotalInvoices
is the largest container of the form.
这篇关于MS Access子表单,表单视图中带有#Error的字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!