A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Updating Time when Form Cell is entered



 
 
Thread Tools Display Modes
  #1  
Old December 6th, 2006, 07:12 PM posted to microsoft.public.access.forms
RA
external usenet poster
 
Posts: 191
Default Updating Time when Form Cell is entered

I want the form to input the current time in the form's cell when you enter
that box.
--------------------------------------------------------------------------------
I have the following entry in a macro and I keep getting an error:

Expression You entered contains invalid syntax

You may have entered an operand without an operator
-----------------------------------------------------------------------------------
MY ENTRY
Item: [Forms]![IntraDay Mgmt - Form]![Time]
Expression: =Time()

  #2  
Old December 6th, 2006, 07:17 PM posted to microsoft.public.access.forms
Lynn Trapp
external usenet poster
 
Posts: 173
Default Updating Time when Form Cell is entered

Could you explain what you mean by the "form's cell?"

--

Lynn Trapp
Microsoft MVP (Access)
www.ltcomputerdesigns.com


"RA" wrote in message
...
I want the form to input the current time in the form's cell when you enter
that box.
--------------------------------------------------------------------------------
I have the following entry in a macro and I keep getting an error:

Expression You entered contains invalid syntax

You may have entered an operand without an operator
-----------------------------------------------------------------------------------
MY ENTRY
Item: [Forms]![IntraDay Mgmt - Form]![Time]
Expression: =Time()



  #3  
Old December 6th, 2006, 07:31 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Updating Time when Form Cell is entered

There are no cells in Access. I think you mean control.
A Macro is not the best way to do this.
The better way is to use VBA.
Open the form in design view.
Select the control you want to put the time in.
Open the Properties Dialog
Select the Events tab
Select the Got Focus event
Click on the small command button to the right with the dots ...
Select Code Builder
The VBA Editor will open with the cursor positioned in the event.
Type in the following:

Me.MyControlName = Time()

Replace MyControName with the name of the control.


"RA" wrote:

I want the form to input the current time in the form's cell when you enter
that box.
--------------------------------------------------------------------------------
I have the following entry in a macro and I keep getting an error:

Expression You entered contains invalid syntax

You may have entered an operand without an operator
-----------------------------------------------------------------------------------
MY ENTRY
Item: [Forms]![IntraDay Mgmt - Form]![Time]
Expression: =Time()

  #4  
Old December 6th, 2006, 07:32 PM posted to microsoft.public.access.forms
RA
external usenet poster
 
Posts: 191
Default Updating Time when Form Cell is entered fmr

I have a form called: IntraDay Mgmt - Form
I have a "Text Box" that I want to display the current time when you tab
into it.

I have it set up so that when you open the form, it uses =Time() to set it
with the current time. What is happening is that some people leave the form
open on their desk tops and make entries all day long. Therefore the time
stays at the time they opened the form. I want it to change to the current
time when they enter that Text Box.

"Lynn Trapp" wrote:

Could you explain what you mean by the "form's cell?"

--

Lynn Trapp
Microsoft MVP (Access)
www.ltcomputerdesigns.com


"RA" wrote in message
...
I want the form to input the current time in the form's cell when you enter
that box.
--------------------------------------------------------------------------------
I have the following entry in a macro and I keep getting an error:

Expression You entered contains invalid syntax

You may have entered an operand without an operator
-----------------------------------------------------------------------------------
MY ENTRY
Item: [Forms]![IntraDay Mgmt - Form]![Time]
Expression: =Time()




  #5  
Old December 6th, 2006, 07:39 PM posted to microsoft.public.access.forms
RA
external usenet poster
 
Posts: 191
Default Updating Time when Form Cell is entered

We're getting closer, it now updates when you exit, I need it to update when
you enter the Text Box.


Private Sub Time_GotFocus()
Me.Time = Time()
End Sub


"Klatuu" wrote:

There are no cells in Access. I think you mean control.
A Macro is not the best way to do this.
The better way is to use VBA.
Open the form in design view.
Select the control you want to put the time in.
Open the Properties Dialog
Select the Events tab
Select the Got Focus event
Click on the small command button to the right with the dots ...
Select Code Builder
The VBA Editor will open with the cursor positioned in the event.
Type in the following:

Me.MyControlName = Time()

Replace MyControName with the name of the control.


"RA" wrote:

I want the form to input the current time in the form's cell when you enter
that box.
--------------------------------------------------------------------------------
I have the following entry in a macro and I keep getting an error:

Expression You entered contains invalid syntax

You may have entered an operand without an operator
-----------------------------------------------------------------------------------
MY ENTRY
Item: [Forms]![IntraDay Mgmt - Form]![Time]
Expression: =Time()

  #6  
Old December 6th, 2006, 07:40 PM posted to microsoft.public.access.forms
Lynn Trapp
external usenet poster
 
Posts: 173
Default Updating Time when Form Cell is entered fmr

You have a couple of options.

1. You can add the following code to the Got Focus event of the text box

Me.txtTime = Time()

2. You can have a running timer, by setting the TimeInterval property to
1000 (for one second) and put the code above in the Timer event of the form.

--

Lynn Trapp
Microsoft MVP (Access)
www.ltcomputerdesigns.com


"RA" wrote in message
...
I have a form called: IntraDay Mgmt - Form
I have a "Text Box" that I want to display the current time when you tab
into it.

I have it set up so that when you open the form, it uses =Time() to set it
with the current time. What is happening is that some people leave the
form
open on their desk tops and make entries all day long. Therefore the time
stays at the time they opened the form. I want it to change to the
current
time when they enter that Text Box.

"Lynn Trapp" wrote:

Could you explain what you mean by the "form's cell?"

--

Lynn Trapp
Microsoft MVP (Access)
www.ltcomputerdesigns.com


"RA" wrote in message
...
I want the form to input the current time in the form's cell when you
enter
that box.
--------------------------------------------------------------------------------
I have the following entry in a macro and I keep getting an error:

Expression You entered contains invalid syntax

You may have entered an operand without an operator
-----------------------------------------------------------------------------------
MY ENTRY
Item: [Forms]![IntraDay Mgmt - Form]![Time]
Expression: =Time()






  #7  
Old December 6th, 2006, 07:46 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Updating Time when Form Cell is entered

Interesting. It works for me. As soon as I tab to the control or click into
it, the time displays. I am on 2003 and XP Pro.

"RA" wrote:

We're getting closer, it now updates when you exit, I need it to update when
you enter the Text Box.


Private Sub Time_GotFocus()
Me.Time = Time()
End Sub


"Klatuu" wrote:

There are no cells in Access. I think you mean control.
A Macro is not the best way to do this.
The better way is to use VBA.
Open the form in design view.
Select the control you want to put the time in.
Open the Properties Dialog
Select the Events tab
Select the Got Focus event
Click on the small command button to the right with the dots ...
Select Code Builder
The VBA Editor will open with the cursor positioned in the event.
Type in the following:

Me.MyControlName = Time()

Replace MyControName with the name of the control.


"RA" wrote:

I want the form to input the current time in the form's cell when you enter
that box.
--------------------------------------------------------------------------------
I have the following entry in a macro and I keep getting an error:

Expression You entered contains invalid syntax

You may have entered an operand without an operator
-----------------------------------------------------------------------------------
MY ENTRY
Item: [Forms]![IntraDay Mgmt - Form]![Time]
Expression: =Time()

  #8  
Old December 6th, 2006, 07:47 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Updating Time when Form Cell is entered

How about

Private Sub Time_LostFocus()
Me.Time = Time()
End Sub

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"RA" wrote in message
...
We're getting closer, it now updates when you exit, I need it to update
when
you enter the Text Box.


Private Sub Time_GotFocus()
Me.Time = Time()
End Sub


"Klatuu" wrote:

There are no cells in Access. I think you mean control.
A Macro is not the best way to do this.
The better way is to use VBA.
Open the form in design view.
Select the control you want to put the time in.
Open the Properties Dialog
Select the Events tab
Select the Got Focus event
Click on the small command button to the right with the dots ...
Select Code Builder
The VBA Editor will open with the cursor positioned in the event.
Type in the following:

Me.MyControlName = Time()

Replace MyControName with the name of the control.


"RA" wrote:

I want the form to input the current time in the form's cell when you
enter
that box.
--------------------------------------------------------------------------------
I have the following entry in a macro and I keep getting an error:

Expression You entered contains invalid syntax

You may have entered an operand without an operator
-----------------------------------------------------------------------------------
MY ENTRY
Item: [Forms]![IntraDay Mgmt - Form]![Time]
Expression: =Time()



  #9  
Old December 6th, 2006, 07:51 PM posted to microsoft.public.access.forms
RA
external usenet poster
 
Posts: 191
Default Updating Time when Form Cell is entered

Do you see anything slightly wrong with my entry below?

"Klatuu" wrote:

Interesting. It works for me. As soon as I tab to the control or click into
it, the time displays. I am on 2003 and XP Pro.

"RA" wrote:

We're getting closer, it now updates when you exit, I need it to update when
you enter the Text Box.


Private Sub Time_GotFocus()
Me.Time = Time()
End Sub


"Klatuu" wrote:

There are no cells in Access. I think you mean control.
A Macro is not the best way to do this.
The better way is to use VBA.
Open the form in design view.
Select the control you want to put the time in.
Open the Properties Dialog
Select the Events tab
Select the Got Focus event
Click on the small command button to the right with the dots ...
Select Code Builder
The VBA Editor will open with the cursor positioned in the event.
Type in the following:

Me.MyControlName = Time()

Replace MyControName with the name of the control.


"RA" wrote:

I want the form to input the current time in the form's cell when you enter
that box.
--------------------------------------------------------------------------------
I have the following entry in a macro and I keep getting an error:

Expression You entered contains invalid syntax

You may have entered an operand without an operator
-----------------------------------------------------------------------------------
MY ENTRY
Item: [Forms]![IntraDay Mgmt - Form]![Time]
Expression: =Time()

  #10  
Old December 6th, 2006, 07:53 PM posted to microsoft.public.access.forms
RA
external usenet poster
 
Posts: 191
Default Updating Time when Form Cell is entered

Could my default value in the table of =Time(), impact what is showing in the
Text Box?

"Klatuu" wrote:

Interesting. It works for me. As soon as I tab to the control or click into
it, the time displays. I am on 2003 and XP Pro.

"RA" wrote:

We're getting closer, it now updates when you exit, I need it to update when
you enter the Text Box.


Private Sub Time_GotFocus()
Me.Time = Time()
End Sub


"Klatuu" wrote:

There are no cells in Access. I think you mean control.
A Macro is not the best way to do this.
The better way is to use VBA.
Open the form in design view.
Select the control you want to put the time in.
Open the Properties Dialog
Select the Events tab
Select the Got Focus event
Click on the small command button to the right with the dots ...
Select Code Builder
The VBA Editor will open with the cursor positioned in the event.
Type in the following:

Me.MyControlName = Time()

Replace MyControName with the name of the control.


"RA" wrote:

I want the form to input the current time in the form's cell when you enter
that box.
--------------------------------------------------------------------------------
I have the following entry in a macro and I keep getting an error:

Expression You entered contains invalid syntax

You may have entered an operand without an operator
-----------------------------------------------------------------------------------
MY ENTRY
Item: [Forms]![IntraDay Mgmt - Form]![Time]
Expression: =Time()

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:50 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.