GetGreater
Applies to
VAccess
Description
Attempts to retrieve the first record that is the greater than the key in the current index path and returns, as an Integer value, the PSQL status code.
Syntax
object.GetGreater [vLockBias]
The syntax for this method has the following parts:
 
vLockBias
Remarks
This method attempts to retrieve the first record which contains a value in the currently selected index field(s) which is greater than the value specified for the field(s) prior to the operation, from the file associated with the control. Before executing this operation, you must set the value of the field or fields which make up the index specified in the IndexNumber property.
If the key fields are bound to field controls, their value will be set by modifying the contents of the bound controls. To set these values from code, use the FieldValue property.
The status code for the operation will be returned by the method and set in the Status property of the control, a value of zero indicating success. A Status Code 9 indicates that no records in the file have a key value greater than that specified prior to the operation.
Example
'Retrieve the first record where the last
'name begins with S
Customers.IndexNumber = 1 'last name
Customers.FieldValue("last_name") = "S"
Customers.GetGreater
Select Case Customers.Status
Case 0
'we got a record, but we must test to see
'if it matches our criteria - GetGreater
'method does not do this. If there are no
'"S" records in the file, this record may
'be a "T", "U", "V", and so forth...
If Left$(Customers.FieldValue _
("last_name"), 1) = "S" Then
MsgBox "Found: " & Customers.FieldValue _
("last_name")
Else
MsgBox "No record was found."
End If
Case Else
MsgBox "No record was found."
End Select