
not to auto update while doing addnew
On Wed, 20 Jun 2001 04:07:31 GMT, "Ray Cheng"
Quote:
>can someone answer me this easy question?
>i'm using ms access database with vb.
>i have a set of records in the database, but when i move
>from records to records, it will automatically updates the
>fields in the database if there are changes made. for the
>addnew method call, it also does the auto update. now,
>how can i avoid the auto update from happening?
>ray
Are you using ADO or DAO? All the information really helps.
If you are using ADO, you can dimension your recordset as follows
Dim Withevents rs as ADODB.recordset
rather then
DIm rs as ADODB.Recordset.
You can now place code in the WillMove event of the recordset, and if
you do not want to keep changes to fields, execute the CancelUpdate
method. See the vb help for Recordset Properties.
If you are using a datacontrol instaed of a recordset, the solution is
similar. Use the datacontrol's events to cancel updates before the
move.
Richard.