PDA

View Full Version : exclude boxes from script



Adonaioc
10-24-2008, 07:14 AM
This is my code, it works fine accept i want to move my counter from the footer to the header. when i do that i get an error that says i cant set the value for these boxes. is there a way to exclude them from this script?

Private Sub cmdReset_Click()
'Purpose: Clear all the search boxes in the Form Header, and show all records again.
Dim ctl As Control

'Clear all the controls in the Form Header section.
For Each ctl In Me.Section(acHeader).Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox
ctl.Value = Null
Case acCheckBox
ctl.Value = False
End Select
Next

'Remove the form's filter.
Me.FilterOn = False
End Sub

CreganTur
10-24-2008, 11:37 AM
I'm not sure what you mean by 'counter'. Are you using an activeX object, or are you just using a textbox formatted to serve as a counter?

You state that the code works fine until you try to add the 'counter' to the Form Header, so there's obviously an issue with that object.
Can you post an example database that duplicates this issue so we can take a look at it?