Results 1 to 2 of 2
  1. #1
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Command button code (2007)

    I have noticed a few improvements in the code created by the wizards for command buttons.

    The Delete Record code is now:

    DoCmd.RunCommand acCmdSelectRecord
    DoCmd.RunCommand acCmdDeleteRecord

    instead of the archaic DoMenuItem code that has been used previously.


    The code for a Close Form button is now:

    If Me.Dirty Then Me.Dirty = False
    DoCmd.Close

    But this throws an error if you put the button on an unbound form.
    Attached Images Attached Images
    Regards
    John



  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Command button code (2007)

    Thanks for the heads-up. Nice to see that Microsoft finally did away with the old DoMenuItem code, even if the implementation isn't flawless.

Posting Permissions

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