Enter current date into field Button!!!

comptechbranden

Registered User.
Local time
Today, 17:29
Joined
May 25, 2006
Messages
119
What code would I use and how would I insert it into my Code to make a button on a form fill in the current date into [fieldname]???

I think I already know who is going to respond to this! ;)

Thanks! :D
 
use something like below in the On_Click event of you button

me.[ControlName]= Date()
 
Hello:
'
If you had a command button name command1 and a text box name text1, the below code would place todays date in the text1 text box.

Private Sub Command1_Click()
Text1.Value = Date
End Sub
'
Regards
Mark
 
I knew it was easy...And yes I figured one of you guys would respond. Now if Ken responds we have all the smart forum posters posting on this topic, haha!

I am going to rate marks answer better because its descriptive and lets me know how the code above will look in my code. ;)

Thanks guys.
 
Last edited:
Whats the fastest way to code in 16 of these buttons? Do I just half to put in one at a time or can I make the code, copy it 16 times making sure all the values are correct, then tossing in 16 boxes naming them the corresponding name as the code has.
 
Wouldn't it be more feasible to use default values against your fields?
Would be a bit more user friendly ;)

RV
 
Well I half to track the dates of when these 16 tasks get done. It isnt a default value by any means. A person will be leaving the form and returning back to it when he/she finishes thier task they will hit this button to tell everyone they finished this task on this date. ;)

As for having the text boxes...this allows us to sort these dates or put these dates in our reports however we want because it is a valuable piece of information for us or our clients that way.
 
Last edited:
OK, use Keith's suggestion then.
Put the code in the ON Click event of each and every button.

RV
 
I was afraid I would half to make these buttons and go to the code for every one of them...
 
Do you store each and every single task in a single column in yout table?
I'm asking because if you would create one row per task, you should be able to use one and only one button.

Otherwise, post your database so we can a quick look.

RV
 

Users who are viewing this thread

Back
Top Bottom