Refresh A Subform

MaximusArcher

Registered User.
Local time
Today, 23:43
Joined
Apr 7, 2005
Messages
15
Age old problem...

Refreshing a sub form.

I have a form in which a 'read-only' sub form is placed. The sub form is based on a query.
I have a button on the main form which opens another form with check boxes which allows updates the to table.

I want the readonly subform to refresh/requery after the close event of the update form.

What is the event I need to use?
I've tried activate, gotfcous on the main form. I am tearing my hair out.
Cheers,
Matt.
 
Do you have a close button on the update form? If so, put it there.
 
Maximus,
When the update form is opened make sure the form with the read-only sub-form is closed and put this code in the load event of form with the subform:
Private Sub Form_Load()
Me.Refresh
End Sub

Having said that even if you just close the Form with the Subform when the update form is opened and reopen it after the changes are made there shouldnt be any problems. Maybe i have understood this wrong?
Best Regards,
Chris
 
Thanks guys. Coded up the a close button in the end. Bit wierd that the close event on the form wont mimic the same behaviour.

Didn't go with the close main form, open new form because the main form is based on a recordset - too much messing round with remebmering recs etc.

Cheers though!!! Problemo solved.
 
What you should have done is opened the second form as a dialog as this stops all the code after the DoCmd.OpenForm method from executing until the form is closed.
 
I dont understand why that would of helped?
There is no code being executed on the main form once the second form is opened.
 

Users who are viewing this thread

Back
Top Bottom