|
数字变量 这么用 DMax("[RecordNumber]", "TblDocket", "[FiscalYear] = " & strLastFiscalYear) + 1
意思是 [FiscalYear] = strLastFiscalYear) + 1
字符串变量这么用 DLookup("[Password]", "Staff", "[LoginID]='" & Me.txtUser & "'")
意思是 [LoginID]='Me.txtUser'
还可以这么用:Me!总有效金额 = DSum("有效金额", "POS", "流水 = Form!流水号")
Try this
Dim strLastFiscalYear As String
strLastFiscalYear = strCurrentFiscalYear - 1
strNewRecordNumber = DMax("[RecordNumber]", "TblDocket", "[FiscalYear] = " & strLastFiscalYear) + 1
strLastFiscalYear is a variable, you have made part of a literal string (it need concatenating into the string as above).
Also, I think 'strCurrentFiscalYear', 'strLastFiscalYear' and 'strNewRecordNumber' should be Integers not a strings ??
MTB |
|