to : wufang(牛牛) 我不同意 有option explicit可以防止一些变量上的错误 例如: addata="111".......... if adata="111" then msgbox "ok" end if这样,就会产生两个变量,特别是有很多的时候
Dim temp, ddd改为 Dim temp Dim ddd MsgBox (ddd) 改为call MsgBox (ddd)
sorry!! 依据你的想法,刻程序不能实现! 不信,再试试n天n月之后你就知道了。
Option Explicit Dim dstart Dim temp, dddPrivate Sub Form_Load() dstart = Time End SubPrivate Sub Form_Click() temp = Time ddd = DateDiff("d", Now, temp) MsgBox (ddd) End Sub
清楚些好吗
s
???
ddd = DateDiff(s, dstart, temp)
中s 没有定义
中应写成
ddd=datediff("s",dstart,temp),按秒比较
有option explicit可以防止一些变量上的错误
例如: addata="111"..........
if adata="111" then msgbox "ok"
end if这样,就会产生两个变量,特别是有很多的时候
Dim temp
Dim ddd
MsgBox (ddd) 改为call MsgBox (ddd)
不信,再试试n天n月之后你就知道了。
Dim dstart
Dim temp, dddPrivate Sub Form_Load()
dstart = Time
End SubPrivate Sub Form_Click()
temp = Time
ddd = DateDiff("d", Now, temp) MsgBox (ddd)
End Sub