Command button for time & date

  • Thread starter Thread starter joet5402
  • Start date Start date
J

joet5402

I am looking to add START DATE, COMPLETION DATE, START TIME, & FINISH TIME
buttons to an existing form, so that when you press the START DATE button it
would insert the current date into the field; when you press the START TIME -
the current time is inserted and so on. Is this possible?
 
' Insert the current date to a text box
Me.[TextBox] = Date()

' Insert the current Time to a text box
Me.[TextBox] = Time()

' Insert the current date and time to a text box
Me.[TextBox] = Now()
 
I inserted these formulas in the appropriate places, but the only ones that
didn't work were the FINISH TIME text box as well as a DATEREQUESTED text
box. Nothing appeared in the DATEREQUESTED text box when the command button
was clicked, and when I clicked the FINISH TIME command button, it came up as
"Run-time error 438: object doesn't support this property or method". What
am I doing wrong here?

Ofer Cohen said:
' Insert the current date to a text box
Me.[TextBox] = Date()

' Insert the current Time to a text box
Me.[TextBox] = Time()

' Insert the current date and time to a text box
Me.[TextBox] = Now()

--
Good Luck
BS"D


joet5402 said:
I am looking to add START DATE, COMPLETION DATE, START TIME, & FINISH TIME
buttons to an existing form, so that when you press the START DATE button it
would insert the current date into the field; when you press the START TIME -
the current time is inserted and so on. Is this possible?
 
Make sure that the text box names are correct, it could be that you are
trying to assign the value to a lable, or mybe that text box can't ba updated
becuase of it's ControlSource

--
Good Luck
BS"D


joet5402 said:
I inserted these formulas in the appropriate places, but the only ones that
didn't work were the FINISH TIME text box as well as a DATEREQUESTED text
box. Nothing appeared in the DATEREQUESTED text box when the command button
was clicked, and when I clicked the FINISH TIME command button, it came up as
"Run-time error 438: object doesn't support this property or method". What
am I doing wrong here?

Ofer Cohen said:
' Insert the current date to a text box
Me.[TextBox] = Date()

' Insert the current Time to a text box
Me.[TextBox] = Time()

' Insert the current date and time to a text box
Me.[TextBox] = Now()

--
Good Luck
BS"D


joet5402 said:
I am looking to add START DATE, COMPLETION DATE, START TIME, & FINISH TIME
buttons to an existing form, so that when you press the START DATE button it
would insert the current date into the field; when you press the START TIME -
the current time is inserted and so on. Is this possible?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top