有没有办法在表单上显示当前日期和时间? [英] Is there a way to display current date and time on form?

查看:399
本文介绍了有没有办法在表单上显示当前日期和时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个文本框中使用了= now()并且在打开的那一刻很好地显示了日期和时间



我如何显示更新数据?


我想到了一个事件程序,但我会使用哪一个

真的没有任何数据选择或鼠标事件与

日期/时间更新


Jerry

I used =now() in a text box and that nicely displays date and time at
the moment of opening

How would I show updated data?

I thought of an event procedure, but which one would I use since there
really isn''t any data choosing or mouse event associated with the
date/time update

Jerry

推荐答案

试试 ; On Timer"活动。


< je ********* @ pioneer.com>在消息中写道

新闻:ol ******************************** @ 4ax.com ...
Try the "On Timer" event.

<je*********@pioneer.com> wrote in message
news:ol********************************@4ax.com...
我在一个文本框中使用了= now(),并且在打开的那一刻很好地显示了日期和时间

我将如何显示更新数据?

我想到了一个事件程序,但我会使用哪一个
确实没有任何数据选择或鼠标事件与日期/时间相关联更新

Jerry
I used =now() in a text box and that nicely displays date and time at
the moment of opening

How would I show updated data?

I thought of an event procedure, but which one would I use since there
really isn''t any data choosing or mouse event associated with the
date/time update

Jerry



< je ********* @ pioneer.com>在消息中写道

新闻:ol ******************************** @ 4ax.com ...
<je*********@pioneer.com> wrote in message
news:ol********************************@4ax.com...
我在一个文本框中使用了= now(),并且在打开的那一刻很好地显示了日期和时间

我将如何显示更新数据?

我想到了一个事件程序,但我会使用哪一个
确实没有任何数据选择或鼠标事件与日期/时间相关联更新

Jerry
I used =now() in a text box and that nicely displays date and time at
the moment of opening

How would I show updated data?

I thought of an event procedure, but which one would I use since there
really isn''t any data choosing or mouse event associated with the
date/time update

Jerry



您想在表单上显示工作时钟,只显示

当前时间并且不受任何数据约束?您可以使用表格''Timer

事件并更新每分钟,秒或其他任何内容。


或者你在谈论显示日期和时间a记录已创建或

修改?


You want to show a ''working clock'' on your form which just displays the
current time and is not bound to any data? You could use the form''s Timer
event and update every minute, second or whatever.

Or are you talking about showing the date and time a record was created or
amended?


je ********* @ pioneer.com 写道:
我在文本框中使用了= now(),并且很好地显示了日期和时间。打开的那一刻

我如何显示更新的数据?

我想到了一个事件程序,但我会使用哪一个
真的没有没有任何数据选择或鼠标事件与
日期/时间更新
I used =now() in a text box and that nicely displays date and time at
the moment of opening

How would I show updated data?

I thought of an event procedure, but which one would I use since there
really isn''t any data choosing or mouse event associated with the
date/time update




Microsoft Access中的表单有一个Timer事件。


对于名为frmMain且带有标签lblTime的表单,你会有代码

看起来像这样:

Private Sub Form_Load( )

和我一起

.TimerInterval = 1

结束

End Sub


Private Sub Form_Timer()

with me

.lblTime.Caption = Now()

结束

结束子



The forms in Microsoft Access have a Timer event.

For a form named frmMain with a label lblTime, you''d have code that
looks something like this:
Private Sub Form_Load()
With Me
.TimerInterval = 1
End With
End Sub

Private Sub Form_Timer()
with Me
.lblTime.Caption = Now()
End with
End Sub


这篇关于有没有办法在表单上显示当前日期和时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆