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 |
#11
|
|||
|
|||
Updating Time when Form Cell is entered
No luck
Maybe I'm losing Focus!? "Douglas J. Steele" wrote: 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() |
#12
|
|||
|
|||
Updating Time when Form Cell is entered
Actually, something I just noticed is your choice of control name.
Time is a reserved word: you should never use it for your own purposes. Try renaming the text box to txtTime, or something like that. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "RA" wrote in message ... 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() |
#13
|
|||
|
|||
Updating Time when Form Cell is entered
It should not have any effect. There must be something about your control or
the names being used. "RA" wrote: 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() |
#14
|
|||
|
|||
Updating Time when Form Cell is entered
Now I'm getting a
Compile Error: Method or data member not found "Douglas J. Steele" wrote: Actually, something I just noticed is your choice of control name. Time is a reserved word: you should never use it for your own purposes. Try renaming the text box to txtTime, or something like that. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "RA" wrote in message ... 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() |
#15
|
|||
|
|||
Updating Time when Form Cell is entered
Forgot to change my Name in the Properties Box
"RA" wrote: Now I'm getting a Compile Error: Method or data member not found "Douglas J. Steele" wrote: Actually, something I just noticed is your choice of control name. Time is a reserved word: you should never use it for your own purposes. Try renaming the text box to txtTime, or something like that. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "RA" wrote in message ... 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() |
#16
|
|||
|
|||
Updating Time when Form Cell is entered
Does that mean it's working as you want now?
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "RA" wrote in message ... Forgot to change my Name in the Properties Box "RA" wrote: Now I'm getting a Compile Error: Method or data member not found "Douglas J. Steele" wrote: Actually, something I just noticed is your choice of control name. Time is a reserved word: you should never use it for your own purposes. Try renaming the text box to txtTime, or something like that. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "RA" wrote in message ... 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() |
#17
|
|||
|
|||
Updating Time when Form Cell is entered
Hurray!!!!!!!!!!!!!!!!!!!!!!!!!
That's it Thanks a LOT! "RA" wrote: No luck Maybe I'm losing Focus!? "Douglas J. Steele" wrote: 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() |
|
Thread Tools | |
Display Modes | |
|
|