Refresh(), Requery()
These functions let you update the data in views. Don't confuse them with the methods of the same names. REFRESH() updates one or more records in a view with the current data from the original data source. REQUERY() updates an entire view—if it's parameterized, it may prompt for new parameters as well. Usage | nRefreshCount = REFRESH( [ nNumToRefresh [, nStartOffset [, cAlias | nWorkArea ] ] ] ) |
Parameter | Value | Meaning |
nNumToRefresh | Numeric | The number of records to be refreshed from the original. |
nStartOffset | Positive | Back up the specified number of records (relative to the current record in the view) and start the refresh there. |
Omitted or 0 or Negative | Refresh records starting with the current record. | |
cAlias | Character | Refresh records in the work area containing cAlias. |
Omitted | If nWorkArea is also omitted, refresh records in the current work area. | |
nWorkArea | Numeric | Refresh records in the specified work area. |
Omitted | If cAlias is also omitted, refresh records in the current work area. | |
nRefreshCount | Numeric | The number of records actually refreshed. Might be less than nNumToRefresh if you're near end-of-file, for example. |
Example | * This code might be in the Click event of an Edit button * so the user sees the most current information * before editing: =REFRESH() ThisForm.Refresh() |
Usage | nResult = REQUERY( [ cAlias | nWorkArea ] ) |
Parameter | Value | Meaning |
nResult | 1 | View was requeried successfully. |
0 | Requery did not complete successfully. |
Example | * Assume you have a view of the TasTrade employee table * parameterized on Title (job description) with a parameter * called cTitle. To change the open view to look at all the * Sales Reps, you could: cTitle = "Sales Representative" =REQUERY() |
See Also | Create SQL View, CursorSetProp(), Refresh, Requery, Use |
View Updates
Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.