尝试转换这个简单的Excel宏:
Private Sub Command74_Click()
On Error Resume Next
ActiveField = Format(Date, "dd/mm/yyyy") & " " & Format(Time, "hh:mm")
End Sub
进入Access以通过按钮使用以将静态日期和时间输入到字段中。目前这是由Excel文件中的一个按钮运行,只是想在Access中使用它,这是否可能?
答案 0 :(得分:1)
Not quite sure what you mean by "field" ...
However, if a textbox named ActiveField, do this:
Me!ActiveField.Value = Format(Now, "dd/mm/yyyy hh:nn")
or simply:
Me!ActiveField.Value = Now
and apply your format to the Format property of the textbox.
The textbox can be bound to a field of the table/query, the form is bound to.