Results 1 to 3 of 3

Thread: running a current date macro

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2010
    Posts
    23

    running a current date macro

    Hello everyone

    I am trying to set up a button in my form (access) that will autofill the datefield with todays date and appear in the format dd/mm/yyyy. I've attempted a macro to do this but it only works after i ve right clicked in the date box and gone to properties then closed it. I've absolutely no idea why, in the 'set value' section i've used the code;

    Format(Date(),"dd/mm/yyyy")

    Does anyone have any tips as to where I'm going worong, I'd be very grateful

    cheers

    baggers

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Mar 2010
    Posts
    23

    Re: running a current date macro

    What's strange is the date appears to be in the box as you can click in the end of the box and delete one character and then the rest of the date appears?

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: running a current date macro

    Try
    Code:
    TextBox1.Text = Format(Now,"dd/mm/yyyy")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width