Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Posts
    9

    Unanswered: DoCmd.Close acForm, formName, acSaveNo always save a record?

    I have an Access form that is mapping to a SQL Sever table. The form allows users to enter data, and then click a button ADD or CANCEL. The form has a text box ID that is mapping with the primary key ID of the table student. The button ADD works OK, but the problem is the button CANCEL. If a user enters an ID, and the user clicks the CANCEL button, the VBA 'DoCmd.Close acForm, formName, acSaveNo' always save that record.

    Please give me some suggestions?

    Thank you.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    The acSaveNo relates to the form not the data. You want to do someting like Me.Undo (or something - been a while since I worked with bound forms) to cancel the commital of data to the database.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Feb 2005
    Posts
    9
    You are right friend. I should use UNDO before closing the form.

Posting Permissions

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