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. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|