处理子窗体,它将按不同的字段过滤记录和订单。相关代码:
Me.Filter = "[SN] = '" & Me!AcftSN.Value & "'" & " and/
[Formdate] between #" & Format(Me!startdate.Value, "yyyy\/mm\/dd") & "# and/
#" & Format(Me!enddate.Value, "yyyy\/mm\/dd") & "# "
Me.FilterOn = True
Me.OrderBy = "maf.SysAffected"
Me.OrderByOn = True
DoCmd.openreport "MAF Summary", acViewReport, , Me.Filter
输出报告已正确过滤,但未按sysaffected字段排序。如果我删除orderby行,输出是相同的。
我也试过
Me.OrderBy = "me.SysAffected"
Me.OrderBy = "SysAffected"
Me.OrderBy("maf.SysAffected")
Me.OrderBy, "maf.SysAffected"
以及其他一些变体,没有效果
答案 0 :(得分:0)
如果你有一个名为 SysAffected 的字段:
,这应该有效Me.OrderBy = "[SysAffected] Asc"
Me.OrderByOn = True