Office中国论坛/Access中国论坛

标题: 一个很菜的问题 [打印本页]

作者: rachel    时间: 2003-6-12 05:45
标题: 一个很菜的问题
请教!
请问我如何得到这样的一个日期
以下的一个表
名称  状态  完成时间

我想达到的是状态这一字段有三种状态,完成,未完成,进行中,而我怎么样得到当状态为完成时,自己在完成时间这一字段中自动添加当前日期呢?(在其他状态的时候却不会添加日期)
作者: chenghai    时间: 2003-6-12 18:18
在状态的更新后事件写入:
if 状态="完成" then
  完成时间=date()
endif
作者: rachel    时间: 2003-8-5 21:02
我用了這個不行啊,這是為什麼?

Private Sub 狀態_AfterUpdate()
If 狀態 = "完成¨" Then
  完成時間 = Data()
End If
End Sub


[此贴子已经被作者于2003-8-5 13:50:44编辑过]


作者: 阿罗    时间: 2003-8-5 21:44
hi Rachel, HOW ARE YOU DOING? ---- ok, i'm kidding... So, how's everybody, are you guys still hanging around in Central Perk? Oh, by the way, tell Gunther that I like his hair cut and I'm woundering if next time he can teach me how to speak Dutch.
作者: 阿罗    时间: 2003-8-5 21:48
try this?

Private Sub 完成時間_AfterUpdate()
If 狀態.Value = "完成" Then
  完成時間.Value = Data()
End If
End Sub

作者: rachel    时间: 2003-8-5 22:00
用了以上代碼後的系統信息見下圖

[attach]1349[/attach]




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3