Refresh or Requery

S

Sharon

I have three forms that feed off of one another. The
first, Main Form, shows established information for
accounts. A command button brings the user to a second
form that allows him to add a new record.

The user then selects a third form where he types in
numbers. These numbers are carried to the second form
with some additional calculations. The user closes the
new record to return to the Main Form.

The new record, however, does not show up as in the MAIN
FORM until I close and reopen it. I have tried requery
and refresh on the 2nd and 3rd form's close buttons since
the Main Form never closes in the process.

Is requery the right command to use? If not, what is the
right command? If so, where should I put the requery?
In the first, second, or third forms? In the exit or open
events? What object should I use with the requery? a
form or a field?
 
M

Marshall Barton

Sharon said:
I have three forms that feed off of one another. The
first, Main Form, shows established information for
accounts. A command button brings the user to a second
form that allows him to add a new record.

The user then selects a third form where he types in
numbers. These numbers are carried to the second form
with some additional calculations. The user closes the
new record to return to the Main Form.

The new record, however, does not show up as in the MAIN
FORM until I close and reopen it. I have tried requery
and refresh on the 2nd and 3rd form's close buttons since
the Main Form never closes in the process.

Is requery the right command to use? If not, what is the
right command? If so, where should I put the requery?
In the first, second, or third forms? In the exit or open
events? What object should I use with the requery? a
form or a field?

You would Requery the first form.

I suspect that you haven't saved the record before issuing
the Requery. Try this in the second form's close event:

If Me.Dirty Then Me.Dirty = False
Forms!firstform.Requery
 

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