Sets or returns a value indicating the approximate location of the current record in the CdbRecordset object based on a percentage of the records in the CdbRecordset.
Syntax
VOIDSetPercentPosition(FLOAT fPercent );
FLOATGetPercentPosition(VOID);
Parameters
Type | Argument | Description |
FLOAT | fPercent | A Float between 0.0 and 100.00. |
Remarks
To indicate or change the approximate position of the current record in a CdbRecordset object, you can check or set the PercentPosition property. When working with a dynaset- or snapshot-type CdbRecordset object opened directly from a base table, first populate the CdbRecordset object by moving to the last record before you set or check the PercentPosition property. If you use the PercentPosition property before fully populating the CdbRecordset object, the amount of movement is relative to the number of records accessed as indicated by the RecordCount property setting. You can move to the last record by using the MoveLast method.
Note Using the PercentPosition property to move the current record to a specific record in a CdbRecordset object isn't recommended?the Bookmark property is better suited for this task.
Once you set the PercentPosition property to a value, the record at the approximate position corresponding to that value becomes current and the PercentPosition property is reset to a value that reflects the approximate position of the current record. For example, if your CdbRecordset object contains only five records and you set its PercentPosition property value to 77, the value returned from the PercentPosition property may be 80, not 77.
The PercentPosition property applies to all types of CdbRecordset objects except for forward-only–type CdbRecordset objects or CdbRecordset objects opened from pass-through queries against remote databases.
You can use the PercentPosition property with a scroll bar on a form or text box to indicate the location of the current record in a CdbRecordset object.