Hi,
I would like to use a command button to set current time in the selected text box in a form
Moreover, when I move to the next field i would like the previous value to be stored in the record (saved)
Thanks in advance
Hi,
I would like to use a command button to set current time in the selected text box in a form
Moreover, when I move to the next field i would like the previous value to be stored in the record (saved)
Thanks in advance
Perhaps:
Me.[TextBoxName] = Time()
in the On Click event of the button
And
If Me.Dirty Then Me.Dirty = False
in the Got Focus event of the "next field" textbox.
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
Thanks Bob,
I have copied the syntax you gave me to the on click event of the button (Changed the name to the field in my table)
I get an error massage that it doesn't recognize what is Me (It want to run a macro or provide a macro name)
Have you just pasted it onto the space on the Property Sheet?
It needs to be in the form's code module.
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
Further to my last post I have attached an example database.
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
Most developers stay away from macroes, as they are limited compared to VBA.
I have only used them for batch processes and learnt VBA (as you should )
In Access 2007 you would use
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
Thanks Bob so much
You probably figured that I'm still have large gaps of knowledge
I followed your instructions and even used your DB example
Still I'm getting this:
Microsoft Access cannot find the object Me
If 'Me' is a new Macro group, make sure you have saved it and that you have typed its name correctly
What can it be please
This sounds to me as though you are trying to use a macro in some way.Thanks Bob so much
You probably figured that I'm still have large gaps of knowledge
I followed your instructions and even used your DB example
Still I'm getting this:
Microsoft Access cannot find the object Me
If 'Me' is a new Macro group, make sure you have saved it and that you have typed its name correctly
What can it be please
Like many others here I have little to do with macros, preferring the use of vba code.
Post a copy of your db so that we can determine what is wrong.
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
Thanks so much
I have attached the DB
As far as I can see, your only problem is that in the property sheet for the button's On Click event you have:
but you should have:Code:Me.[Text16] = Time()
as you have in the Got Focus event of the textbox named txtTimeEnd.Code:[Event Procedure]
You already have the correct code in the form's code module for each of the afore mentioned events.
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick