Rabu, 21 Desember 2011

[MS_AccessPros] Re: Clearing all controls in the header with an exception

 

'Clear all the controls in the Form Header section.
For Each ctl In Me.Section(acHeader).Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox
If ctl.Name <> "name of control here" Then
ctl.Value = Null
End If

I will also use the Tag property to choose which controls to act on.

Duane Hookom
MS Access MVP

--- In MS_Access_Professionals@yahoogroups.com, mrsgoudge <no_reply@...> wrote:
>
> I have code to clear all controls in the Form's header without naming each one. Problem is that one of them (Nmbr) has = Count(*) in its control source. How would I insert to skip Nmbr?
>
> Here's the code for the relevant portion:
>
> '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
>
> Thanks much!
> Connie
>

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar