PreviousActiveX Controls Guide (v10) Next

GetGreater

Chapter contents

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 Pervasive PSQL status code.

Syntax

object.GetGreater [vLockBias] 
 

Part
Description
object
Required. The object placeholder represents an object expression that evaluates to an object in the Applies To list.
vLockBias
Optional. Value representing the type of record lock to place on the record when it is retrieved. Default is 0, no lock. One of the following constants:
Const BTO_SingleNoWait = 200
Const BTO_MultiNoWait = 400

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", etc... 
		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 

Chapter contents
Book contents

Prev topic: GetFirst
Next topic: GetGreaterOrEqual