Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wetherby, Yorkshire, England
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Simple Insert Date Code (Access 2000)

    I have a an Access 2k db with a main form and 4 subforms. On these forms I have a few controls that take a date and I have written some macros that enable me to double-click the control to insert today's date. Where the control is named 'Date' (on the form and sub-forms) I need only one macro but I have to write separate macros for the other controls. I would like to write some simple code that does the job of the macros and I feel sure I should be able to do it with one piece of code but I can't find a way of selecting the current control without actually naming it specifically. Can this be done?

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Simple Insert Date Code (Access 2000)

    Screen.ActiveControl is the currently active control. To see the name of the control, use: = Screen.ActiveControl.Name
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wetherby, Yorkshire, England
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Simple Insert Date Code (Access 2000)

    Thanks Mark that works great.
    Peter Herworth

Posting Permissions

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