Doug,
Thankyou for the reference, but it is what I was using
(Forms!frmMain!fsubAdm_Sect.Form!lstMacroSec.Requery) and I still am not able
to get the lstbox to update with the new values.
I have a main form (frmMain) that has a tab control with 4 pages (tabs are
hidden, I use command buttons at the top to switch between pages). On one of
these pages I have another tab control with 7 tabs (not hidden). On each of
these tabs I have a subform. My problem is that when a user adds a new
record to the subform (fsubAdm_MacSec) on the first tab, I want a listbox
(lstMacroSec) on another subform (fsubAdm_Sec) on another tab to update its
values and show the new record added. The record source for both subforms is
a straight SQL statement and if I close the application and reopen the lstbox
reflects the record. I am sure it is a timing thing but I can't figure out
which event to use.
Thank you for your assistance. I have used it many times in the past from
your posts for other people as well.
Shaun
Shaun,
You need to requery the list after the data has been saved.
So, try this.
In the Form_AfterUpdate event of the form behind the fsubAdm_MacSec
subform, put the following:
Parent.subAdm_Sector.Form!lstMacroSector.Requery
In more detail:
1. Open up the fsubAdm_MacSec subform as a form in design view.
2. In the properties window for the form, go to the Events tab.
3. In After Update, set it to [Event Procedure] and click on the
little 3-dots button.
4. Then type in the above statement so that it looks like this:
Private Sub Form_AfterUpdate()
Parent.subAdm_Sector.Form!lstMacroSector.Requery
End Sub
Does that do it?
David Stelle, Access App Developer