Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2006
    Location
    Manila, Philippnes
    Posts
    17

    Unanswered: Help with command buttons

    hello.. i want my form to look like this:

    http://i114.photobucket.com/albums/n...ployeeform.jpg

    where there is add, edit, save and delete buttons.. and that the record cannot be edited unless the "Edit button" is clicked and the entry will only be saved when the "Save" button is clicked.

    i already used button wizard. currently, i have add, save, delete, but there is no edit in button wizard.. and i also want to remove the auto save feature of access.. it should only edit and save records when edit and save buttons are clicked... thanks...

    i tried to search for sample databases, but it doesn't inlcude a sample of this. thank you so much...

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    For the EDIT button:

    In the properties box for the form set Allow Edits to NO

    In the Form_Current sub enter Me.AllowEdits = False

    Place a button on the form.

    Hit CANCEL when the wizard come up (you'll have to set you caption from the button's properties box)

    In Properties double click on the ellipsis (...) to the right of the On Click property

    In the sub that comes up (i.e. YourEditButton_Click) enter

    Me.AllowEdits = True

    As to the preventing Access from automatically saving the record, I'm not sure. Maybe someone else can help you there. My approach is to have a pair of buttons popup when the form becomes Dirty, Save and Do Not Save (with Me.Undo behind this button.)
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    May 2005
    Posts
    119
    Another option, although a lot more coding involved, would be to have the form unbound (no recordset). Have fields load the values upon search results. You can then edit all you want without saving to the table.

    Your data will only be saved/deleted/added if you click the button (which would be a SQL statement to run).

    I kept this vague purposely. I don't want to load you up with too much information. If you want the details, let me know!

    Good luck!
    ~Krista

  4. #4
    Join Date
    Jul 2006
    Location
    Manila, Philippnes
    Posts
    17
    hi guys.. thanks for the response.. i really do appreciate it.. ok, i'll try both.. i'll just keep you posted. thanks a lot.. have a nice day!!!

Posting Permissions

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