Refreshing a Subform

  • Thread starter Thread starter Brennan
  • Start date Start date
B

Brennan

Hello:

I have a main form called Clients that has 1 subform
called Accounts. The endusers have asked that the
information in the subform be dispalyed as a datasheet.
For purposes of data entry, however, they have asked that
a data entry form be created. (The datasheet is long and
they would like to see all the fields when they are doing
data entry)

I have created a columnar form that can be called from a
command button on the Client form and sets the Client ID
to the proper value. The form is a modal form that
appears over the main form. There is a save button
button that allows the user to save the record

My problem is that when the user clicks save, I would
like to be able to save the record and have it appear in
the subform that references the Accounts table.
Currently, you have to close the entire Clients form and
re-open it to refresh the view in the Accounts subform.

Is there a way to use code to refresh this view without
closing the form?

Any suggestions would be appreciated

Thanks
Brennan
 
After you add the records and click the save button you
must close the form right?

What i would do is add a line of code to the "On Close"
event procedure of the form you are closing.

DoCmd.Requery "Forms!frmClients"

Or

Forms!frmClients.Requery

I hope that helps.
 
Hope you can see this message.

The refresh will have to be applied in the main form not
the sub form. After the update action, you add the code
like: me.refresh. Then you will see the updated sub form
without closing the main form.

Shirley
 
Back
Top