By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,655 Members | 1,875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,655 IT Pros & Developers. It's quick & easy.

MS Access 97 - Forcing an Update

P: n/a
Environment: MS Access 97

Problem:
Trying to force a record to update using the recordset.Update
property. What syntax do I need to force a record to be updated? I
have searched the newsgroups and web and haven't found a solution that
works.

Thanks!

The following is the syntax from the help file:
recordset.Update (type, force )

The Update method syntax has the following parts.

Recordset: An object variable that represents an open, updatable
Recordset object.

Type: Optional. A constant indicating the type of update, as specified
in Settings (ODBCDirect workspaces only).

Force: Optional. A Boolean value indicating whether or not to force
the changes into the database, regardless of whether the underlying
data has been changed by another user since the AddNew, Delete, or
Edit call. If True, the changes are forced and changes made by other
users are simply overwritten. If False (default), changes made by
another user while the update is pending will cause the update to fail
for those changes that are in conflict. No error occurs, but the
BatchCollisionCount and BatchCollisions properties will indicate the
number of conflicts and the rows affected by conflicts, respectively
(ODBCDirect workspaces only).
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
The use of recordset.Update refers to when you create a reocrdset in code,
and thus need to do a update.

The above concept has nothing to do with a form bound to a table, as then
you are not manipulating the data via reocrdsets, but are just using forms.

It is not all clear in which context you are referring to updating a record.
(as there is a zillion ways to update records).

If you want in code to force a disk write for a form that is bound to a
table, and not talking about a reocrdset, then you can use:
me.refresh

In the forms code. Since I always restrict my forms to generally one record,
then out of convenience, I use the above syntax. However, many of the more
experienced regulars here do suggest to use:

if me.Dirty = True then
me.Dirty = False
end if

The dirty property is set = true if data has been modified. If you force
dirty = false, then the only thing ms-access can do is to first force a disk
write. Me.Refresh also works, but can cause other records to be loaded
again. Either of the above will force the current record in a bound form to
disk.

If you are talking about recordsets, and code, then your example of using
recordset.update is correct.
--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
No************@msn.com
http://www.attcanada.net/~kallal.msn
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.