A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Compile error- Invalid use of property



 
 
Thread Tools Display Modes
  #1  
Old June 1st, 2010, 10:41 AM posted to microsoft.public.access
jamccarley
external usenet poster
 
Posts: 54
Default Compile error- Invalid use of property

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
  #2  
Old June 1st, 2010, 11:11 AM posted to microsoft.public.access
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Compile error- Invalid use of property

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/Ap****ueBadWord.html

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

"jamccarley" wrote in message
news
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



  #3  
Old June 2nd, 2010, 05:55 AM posted to microsoft.public.access
jamccarley
external usenet poster
 
Posts: 54
Default Compile error- Invalid use of property

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/Ap****ueBadWord.html

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

"jamccarley" wrote in message
news
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



.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.