Proper event for loading subfrm procedure

try increasing or decreasing the interval.
 
@ arnelgp
@ theDBguy


You guys are my Sunday heroes. Both suggestions seem to work perfectly.

@ arnelgp Immediate click on another record in SubFormA makes SubFormB go to the first record. Should I raise the timer interval?



Thank you!!! Thank you!!! Thank you all!!!

Hi. Glad we could all assist. Good luck with your project.
 
try increasing or decreasing the interval.


Well, I had 100% success (on subsequent clicking) by changing timer interval to 300.



Thank you!!!
 
If you want to limit the number of rows displayed in a subform, you can do it without code and without using the timer. All you need to do is to add an order by clause to the RecordSource query of the subform and add a Top 30 predicate. Why bother to retrieve and load thousands of records if you only want to see 30.

If you want to vary the number, add a textbox to the unbound main form with a number. Then you will need to build the subform's query on the fly because the Top predicate is not a variable. it is fixed and cannot be altered.

strSQL = "Select Top " & Nz(Me.recCount,30) & " fld1, fld2, fld3 From YourTable"

Me.subformcontrolname.RecordSource = strSQL
 

Users who are viewing this thread

Back
Top Bottom