SharonInGeorgia
asked on
Access - Difference between Refresh and Requery
Please explain the difference between refresh and requery. My application is focused on having the user select a value from a combo box. That value is transfered between several forms using OpenArgs. Which one, refresh or requery, should I use for the following and where should it be placed?
-The combo box OpenArg opens up a form that allows the user to add a new record directly from a form. Do I need to refresh or requery the table and the combo box? Where should my refresh/requery be placed in the code?
- The combo box OpenArg opens up a form and a subform that allows the user to add a new record. Do I need to refresh the Main and subform? Where should the refresh/requery be placed in the code?
- What other suggestions do you have as far as placing a refresh or requery throughout the application?
-The combo box OpenArg opens up a form that allows the user to add a new record directly from a form. Do I need to refresh or requery the table and the combo box? Where should my refresh/requery be placed in the code?
- The combo box OpenArg opens up a form and a subform that allows the user to add a new record. Do I need to refresh the Main and subform? Where should the refresh/requery be placed in the code?
- What other suggestions do you have as far as placing a refresh or requery throughout the application?
Refresh will update all existing records in the relevant recordset with changes made elsewhere.
It does not deal with new records or deletions.
Requery will do all changes plus new records and deletions.
It does not deal with new records or deletions.
Requery will do all changes plus new records and deletions.
ASKER
Some of my forms allows the user to add a record. Other forms are used just for updating a record. The challenge here is that one form is dependent on the values added or changed of a previous form. It is a good practice to add refresh and requery to the code in after update?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
- Requery will update data shown in a form, combo rowsource, etc with updated values from the underlying table. You would use this to display current data reflecting any changes that have been made behind the scenes.