Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    173

    Unanswered: Undo/Delete Commands based on Form Events

    I have a form with Add - Save - Delete Buttons

    When a New Record is being Added, I'd like the Delete Button to Read "Undo", and allow the user to Undo the Record.

    Also, when an existing Record is being Edited, I'd like the Delete Button to Read "Undo".

    Otherwise, just have the Delete button read "Delete"

    I know how to set the captions, and run different code depending on the Caption of the Delete button, but what events do I use to determine if it is a new record, or an existing record being edited?

    Does the Dirty Event come into play here?

    Thanks - AB

  2. #2
    Join Date
    May 2003
    Posts
    144
    You know how to run different script based on the caption of the button. You can determine the "New" and "Edit" based on the caption of the form. When your form is called, pass along an openargs such as "New Record" or "Edit Record".

    Hope this helps.

    SHK

  3. #3
    Join Date
    Aug 2004
    Posts
    173

    How do I know if record is being edited?

    Thanks for the reply, but if a user is using the navigaqtion buttons to cycle thru existing records and edits one, how do I know?



    Quote Originally Posted by SHK
    You know how to run different script based on the caption of the button. You can determine the "New" and "Edit" based on the caption of the form. When your form is called, pass along an openargs such as "New Record" or "Edit Record".

    Hope this helps.

    SHK

  4. #4
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    With the Coding
    Private Sub Form_Current()
    If Me.NewRecord Then
    Command4.Caption = "Undo"
    Else
    Command4.Caption = "Delete"
    End If

    End Sub

    2 use the undo function read up on the me.dirty
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

Posting Permissions

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