Update/refresh/requery all fields in a form

  • Thread starter DominicGreco via AccessMonster.com
  • Start date
D

DominicGreco via AccessMonster.com

I want to embed a piece of code in a "Previous Record" and "Next Record"
button that will update (requery) ALL the combo boxes on a form.

I use a Query to populate a combo/list box. However, after the data is
entered and the record saved, I move to thw next record. If I go back to the
previous record, it looks like the combo boxes retain the information from
the last entry. I need to constantly hit "F9" to refresh them so that I can
see the entered data.

Can someone point me in the direction on how this is done? I've tried looking
under "Refresh" in the help file, in my miriad Access Books, or on line and
haven't been able to find anything useful.
 
J

John W. Vinson

Can someone point me in the direction on how this is done? I've tried looking
under "Refresh" in the help file, in my miriad Access Books, or on line and
haven't been able to find anything useful.

Me.Refresh


Maybe you were checking in the Help from the design window rather than from
the VBA editor? That gets you a different help file.

From the VBA help file:

Refresh Method
See AlsoApplies ToExampleSpecificsThe Refresh method immediately updates the
records in the underlying record source for a specified form (form: An Access
database object on which you place controls for taking actions or for
entering, displaying, and editing data in fields.) or datasheet (datasheet:
Data from a table, form, query, view, or stored procedure that is displayed in
a row-and-column format.) to reflect changes made to the data by you and other
users in a multiuser environment.

expression.Refresh
expression Required. An expression that returns one of the objects in the
Applies To list.


Or Me.Requery, although that is rather more drastic; it will (among other
things) reposition your form to the first record in the recordset.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top