Update
Applies to
VAccess
Description
Attempts to update the current record with the contents of the current data buffer, and returns, as an Integer value, the PSQL status code.
Syntax
object.Update
The syntax for this method has the following parts:
 
Remarks
This method attempts to update the current record with the contents of the current data buffer in the file associated with object, and returns the PSQL status code from the operation. A return value of zero indicates success.
A return value of 5 indicates that the record could not be updated because a field or fields in the data buffer used in a key or keys defined for the file which do not allow duplicate values, contain values of another record already in the file. A return value of 80 indicates that a conflict has occurred, i.e. that the record has been updated by another process between the time it was read and the time the Update method was invoked.
If you want to perform a no-currency-change operation, use the KeyNumber property.
Example
'Find record, change company name, update record
'Set the search values
Customers.FieldValue("name") = "John Harbison"
 
'Set the index and do the search
Customers.IndexNumber = 1
Customers.GetEqual
 
'If the record exists, change the company name
'and update it
Select Case Customers.Status
Case 0
Customers.FieldValue("company_name") = _
"Harbison Consulting"
Customers.Update
Case 4
MsgBox "Record not found."
Case Else
MsgBox "Error. PSQL status = " + _
Customers.Status
End Select