Buttons

NotSoC#

Registered User.
Local time
Today, 16:44
Joined
Sep 19, 2001
Messages
12
Can someone please tell me how i can do the following.........I have created a button on a form.....When i click on the button i would like todays date to appear in a text box i also created (The text box is DipatchDate).......

Thanx for any help...........C
 
Hummm, you're using Macros, not sure...in code it's fairly simple (I imagine there's something similar in Macros):
Code:
Private Sub buttonName_Click()
    Me.[FieldName] = Date
End Sub

Instead of going to the Macro Builer, just open the Code Builder and fill in between the opening and closing of the Sub(routine). Try converting some of your familiar Macros to VBA and see what they do. It's all fairly similar, but VBA gives you more flexibility and runs much faster, as well as allowing for error trapping.

In the interest of simplicity, could you also use the Default Value of the text box itself? That way a new record would have that field already filled in...

Good luck,
David R
 
I can use code to do this no problem.......i have to do it this way for college and i hav'nt a clue about macro's.......
..............
Cheers...........C
 
If you must use a macro (for whatever reason), use the SetValue action. Run the macro on the OnClick event of your command button.

Have a good day!
 
Why not tell your college there's no error handling when using Macros and for that reason experienced programmers rarely use them
smile.gif
 
Why would they require you to use something that's even Microsoft acknowledges will be discontinued?
I feel your pain. I've used macros about 3x when I didn't know the VBA, and then converted it to learn for next time.
 

Users who are viewing this thread

Back
Top Bottom