Refresh Subform

brsawvel

Registered User.
Local time
Today, 18:04
Joined
Sep 19, 2007
Messages
256
Hello,

I have a main form with textboxes, selecting buttons, a save button, and a subform.

Each selecting button brings up a different subform: each containing a different listbox.

I set the save button to refresh the listbox by entering the following code:

Code:
....subfrm1.form.listbox1.sourceobject = "frm1"

The problem is that this code only determines the sourceobject for the subform. So if I'm working with the records of listbox in "frm2" and hit the save button, the subform reverts to the listbox in "frm1". And I have to click the selecting button to take me back to "frm2".

Is there a code that I can replace the above code with that tells the subform to refresh instead so the sourceobject doesn't change?
 
You just need a requery:

Me.subfrm1.Form.listbox1.Requery
 

Users who are viewing this thread

Back
Top Bottom