Subforms won't refresh after new record

P

Peter Stone

Access 2003, XP Pro

I have a main form frmDestination with two subforms. I go to records by
clicking on some list boxes.

To add a new record, I
(1) Select Records, Data Entry.
(2) Make a selection in cboGeography on frmDestination
(3) Enter text in txtName and make a selection in a combo on fsubName
(4) Make a selection in cboPtOf on fsubPartOf

fsubPartOf has some code on the After Update event that saves the new record
and then goes to a previously selected record in cboDestination on the main
form.

If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord

Me.Parent.Requery
Me.Parent!fsubName.Form.Requery
Me.Requery

Me.Parent!cboSubdestination = Me.Parent!cboDestination

Me.Parent.Refresh
Me.Parent!subform.Form.Refresh
Me.Refresh

cboSubdestination has code on the After Update event to go to that record.

The problem is the main form displays the correct record, but the two
subforms become blank and won't refresh until I close and reopen the form.

I have also tried refreshing without code by clicking to another record and
frmDestination once again displays the correct record, but in this case the
subforms continue to display the recently entered new data and won't refresh
until I close and reopen the form.

When I reopen the form the new data has been saved correctly.

I've tried all sorts of refreshes and requeries without luck. Any
suggestions how to successfully refresh or requery the form on a new record.

FYI: My Child field/master field links all look OK.

Thank you

Peter
 

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