perfect, thanks! "Rick Brandt" <rickbrandt2[ at ]hotmail.com> wrote in message news:RJRQg.3427$GR.2757[ at ]newssvr29.news.prodigy.net...
[Quoted Text] > Kurt Neumann wrote: >> i have a form with a subform attached. actually the subform does not >> share data with the same form, but is an independent table. > > That is how it should be in almost all cases. > >> The table >> on which the subform is based is edited and records are added from >> another dabase with a linkded table. I would like to have the subform >> requeried every time >> the underlying table is added to. Is there anyway to do this? > > There is no way for this to happen directly, but if ALL edits to the table > leave some evidence that your database with the subform is in can "see" > then the subform can have Timer code that tests for that evidence every so > often. For example; if every row in the table had a LastModified Date/Time > field then your subform could retrieve the maximum value of that field > every few seconds and compare it to the last one that it retrieved. Any > time the values are different then issue a Requery. > > Of course depending on the number of records and how "expensive" it is to > do a Requery, you could just simply issue a Requery every time the Timer > event fires and be done with it. > >> An >> alternative would be to requery the subform via an action on the main >> form. But if I issue a "forms![subfrm].Requery" statement, from >> the main form I get an error that the subform is not recognized as >> being opened. Is there an easy solution? > > A form displayed in a subform is not technically "opened". Just use... > > Me!SubformControlName.Form.Requery > > ...or you could just have the subform issue the Requery on itself... > > Me.Requery > > -- > Rick Brandt, Microsoft Access MVP > Email (as appropriate) to... > RBrandt at Hunter dot com > > >
|