Results 1 to 2 of 2

Thread: Cancel AddNew

  1. #1

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Post

    I am working on a for that sets up user info for a program especially username and password. When the form loads it issues the Addnew command so all the data is cleared out of the textboxs and all and the person can just type into the texboxs linked to the database. Then when they press the command button 'ADD' it issues the Update command. Well if the user they are entering already exists then it won't be added. It checks the indexed username for a match to see if the user is already in the database. Well I tried to then see if the password matchs the one entered on the new record but when I use filter to get the already entered info it throws an error because it is still in trying to add the new info.
    Now my question is how can I cancel the previous add new that I issued so I can move about the database after an error has occurred? Thanks.

  2. #2
    Addicted Member
    Join Date
    Oct 1999
    Posts
    253

    Post

    If you are using ADO, you can execute the CancelUpdate command. The recordset will then cancel the AddNew command.

    Pay attention to the fact that after using this command, the recordset always moves to an unknown record, so you need to use MoveFirst or something similar immediately after the CancelUpdate.

    Good Luck!!!

Posting Permissions

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



Click Here to Expand Forum to Full Width