From: jamccarley on
I am using a simple code to change everthing in the field to CAPS. For some
reason all of my fields work except one. The code is the same as all of the
others, ecept it gives a "Compile error- Invalid use of property" error. Here
is the code.

Private Sub Controls_AfterUpdate()
On Error GoTo Err_Controls_AfterUpdate
Me.Controls = UCase(Me.Controls)

End Sub
Err_Controls_AfterUpdate
MsgBox Err.Description
Resume Exit_Controls_AfterUpdate

End Sub
From: Douglas J. Steele on
Rename the control. Controls is a reserved word (all forms and reports have
a Controls collection associated with them)

For a comprehensive list of names to avoid (as well as a link to a free
utility to check your application for compliance), see what Allen Browne has
at http://www.allenbrowne.com/AppIssueBadWord.html

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
Co-author: Access 2010 Solutions, published by Wiley
(no e-mails, please!)

"jamccarley" <jamccarley(a)discussions.microsoft.com> wrote in message
news:D287B951-5F6F-4A8E-A88B-96582AD3CEAA(a)microsoft.com...
>I am using a simple code to change everthing in the field to CAPS. For some
> reason all of my fields work except one. The code is the same as all of
> the
> others, ecept it gives a "Compile error- Invalid use of property" error.
> Here
> is the code.
>
> Private Sub Controls_AfterUpdate()
> On Error GoTo Err_Controls_AfterUpdate
> Me.Controls = UCase(Me.Controls)
>
> End Sub
> Err_Controls_AfterUpdate
> MsgBox Err.Description
> Resume Exit_Controls_AfterUpdate
>
> End Sub


From: jamccarley on
That worked great. Thanks

"Douglas J. Steele" wrote:

> Rename the control. Controls is a reserved word (all forms and reports have
> a Controls collection associated with them)
>
> For a comprehensive list of names to avoid (as well as a link to a free
> utility to check your application for compliance), see what Allen Browne has
> at http://www.allenbrowne.com/AppIssueBadWord.html
>
> --
> Doug Steele, Microsoft Access MVP
> http://www.AccessMVP.com/DJSteele
> Co-author: Access 2010 Solutions, published by Wiley
> (no e-mails, please!)
>
> "jamccarley" <jamccarley(a)discussions.microsoft.com> wrote in message
> news:D287B951-5F6F-4A8E-A88B-96582AD3CEAA(a)microsoft.com...
> >I am using a simple code to change everthing in the field to CAPS. For some
> > reason all of my fields work except one. The code is the same as all of
> > the
> > others, ecept it gives a "Compile error- Invalid use of property" error.
> > Here
> > is the code.
> >
> > Private Sub Controls_AfterUpdate()
> > On Error GoTo Err_Controls_AfterUpdate
> > Me.Controls = UCase(Me.Controls)
> >
> > End Sub
> > Err_Controls_AfterUpdate
> > MsgBox Err.Description
> > Resume Exit_Controls_AfterUpdate
> >
> > End Sub
>
>
> .
>