Public Function gengxindate()
Dim SQL As String
Dim dtej As Date
Dim dtex As Date
dtej = DLookup("日期", "表1")
dtex = dtej + 1
SQL = "UPDATE 表1 " & _
"SET 表1.日期 = dtex " '这里错了,该怎么改呢?
DoCmd.RunSQL SQL
End Function
运行这个函数时提示输入参数"dtex",
谢谢二位,问题解决了
Public Function gengxindate()
Dim SQL As String
Dim dtej As Date
Dim dtex As Date
dtej = DLookup("日期", "表1")
dtex = dtej + 1
Date = dtex
SQL = "UPDATE 表1 SET 表1.日期 = #" & dtex & "#"
DoCmd.RunSQL SQL
End Function
因为电脑主板坏了,每次开机系统日期都回到2004-1-1,所以想用这段代码来更改系统日期,
没系统的学过VBA,对这些符号& '' " ' '() ...很是不解
原帖由 07688971217 于 2008-12-20 19:10 发表
谢谢二位,问题解决了
Public Function gengxindate()
Dim SQL As String
Dim dtej As Date
Dim dtex As Date
dtej = DLookup("日期", "表1")
dtex = dtej + 1
Date = dtex
SQL = "UPDATE 表1 SET 表1.日期 ...