View Full Version : Requery recordset of subforms


DS
03-02-2001, 02:53 AM
I have a form, with 3 subforms on it. These subforms simply display a number of records based on a query set in the subforms recordsource property.

What I want to do is automatically display the latest records in the subforms at regular intervals without user interaction. What I did was issue the following commands in the timer event for the main form:-

me.subform1.requery
me.subform2.requery
me.subform3.requery

and set the timer interval to the required interval.

When I load the form, the records appear correctly, then the timer event gets executed (I stepped thru the code to make sure), but the subforms do not display the latest set of data. I have to unload and reload the main form to get the latest data.

Am I doing something wrong or can anyone think of another way of doing this.

Thanks in advance
DS

KevinM
03-02-2001, 04:18 AM
Try...

Forms!MainForm!SubForm1.Refresh

OR

Forms!MainForm!SubForm1.Form.Refresh


etc

hth

DS
03-02-2001, 05:19 AM
tried that, doesn't work....refresh simply updates and data that has altered, not add/remove records that match the query.


I have also tried setting the timer and event property of the sub-forms and running them as individual forms....still no joy....so problem not to do with the fact they are subforms

Thanks
DS