PDA

Click to See Complete Forum and Search --> : Cancel AddNew


Edneeis
Mar 9th, 2000, 02:16 PM
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.

Forest Dragon
Mar 9th, 2000, 07:01 PM
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!!!