The best way to handle this, is to make your form unbound. On load of the form, you populate your fields with the data from the ADO Recordset.
rs.Open (using a connection that should already be open)
With rs
Me.Field1 = !Field1
Me.Field2 = !Field2
etc.
End With
rs.Close
The user can now edit the fields at will, without the data being affected at all.
Add a "Save" button to your form. After the user selects the save button, you either use the Recordset.Edit method:
rs.Open (using a connection that should already be open)
With rs
.Edit
!Field1 = Me.Field1
!Field2 = Me.Field2
etc.
.Update
End With
rs.Close
Or use a the Connection.Execute method with an UPDATE statement:
strSQL = "UPDATE tblYourTable SET Field1 = '" & Me.Field1 & "', Field2 = '" & Me.Field2 & "' WHERE ....
Connection.Execute strSQL
This way has certain advantages:
1) The user cannot affect the data by simply editing the form (which is the case in a bound form)
2) Since the form is not bound, you don't have to actually "Cancel" or "Undo" the record if the user selects the "Cancel" button, you simply close the form.
We did this for an entire application with obvious modifications, and the performance was fantastic. I have some samples of forms that use this method if you are interested.
Jim Lunde
compugeeks@hotmail.com
Custom Application Development