AOB
Registered User.
- Local time
- Today, 06:51
- Joined
- Sep 26, 2012
- Messages
- 637
Hi there,
I have a subform which lists a set of records. In the footer section of the subform, I have a number of controls which display calculations based on the records present.
The number of records in the subform will change (reduce). Basically, this is a review / approval function, the idea being that each record will be checked and approved, which will then remove it from the list.
So eventually, all of the records in the subform should disappear (the subform is requeried each time the user approves a record)
I want to be able to hide the controls in the footer section once the subform has been cleared of all records.
But not sure
a) how to determine when the subform's recordset reaches zero and
b) what event to use to fire the code to hide the footer controls.
This is my basic attempt :
But it doesn't work (it only seems to fire when the subform is loaded, not when it is requeried after each approval?)
Can anybody point me in a direction? I've tried Form_Query, Form_DataChange and Form_DataSetChange but no joy with those either.
Thanks
AOB
I have a subform which lists a set of records. In the footer section of the subform, I have a number of controls which display calculations based on the records present.
The number of records in the subform will change (reduce). Basically, this is a review / approval function, the idea being that each record will be checked and approved, which will then remove it from the list.
So eventually, all of the records in the subform should disappear (the subform is requeried each time the user approves a record)
I want to be able to hide the controls in the footer section once the subform has been cleared of all records.
But not sure
a) how to determine when the subform's recordset reaches zero and
b) what event to use to fire the code to hide the footer controls.
This is my basic attempt :
Code:
Private Sub [COLOR=red]Form_Current[/COLOR]()
[INDENT]Dim ctl As Control
For Each ctl In Me.FormFooter.Controls
[INDENT]ctl.Visible = Not ([COLOR=blue]Me.Recordset.EOF[/COLOR])
[/INDENT]Next ctl
[/INDENT]End Sub
But it doesn't work (it only seems to fire when the subform is loaded, not when it is requeried after each approval?)
Can anybody point me in a direction? I've tried Form_Query, Form_DataChange and Form_DataSetChange but no joy with those either.
Thanks
AOB