Solved Auto Capitalization in VBE.

Sun_Force

Active member
Local time
Today, 13:36
Joined
Aug 29, 2020
Messages
396
I'm not sure if I'm using the correct terminology. But recently VBE doesn't capitalize several properties.
It's not all but for now, I've noticed Visible & Enabled are two that stay lowercase. Even if I type them with a capital letter, they change to lowercase.

1.jpg


Is there any way I can correct this behavior?

Thank you.
 
Is the code in the class module of a form or report? If it is in a standard module, "Me." has no meaning and so neither would its properties. When you type Me. in that procedure are you seeing intellisense? That is also a clue.

Don't forget to make sure you have Option Explicit in the header of every module. Make sure this is set as the default. You want to find errors at compile time, NOT at run time.
 
I have Option Explicit on all my modules. It's set as default.
The above code is on_Click event of a button in a form.
And yes, I see the intellisense after adding dot after me. But when I choose visible from the list of properties, it changes to lowercase.

This behavior is seen in all modules. for example the following is a part of a function in a module.

2.jpg


The code works. No error, and the result is as expected. Only they tend to be lowercase.
 
From what I read it could be caused by
  1. You have named one of the modules as value
  2. You have a variable called value in one of your procedures/functions
  3. You have a procedure/function with that name
I would do a find just to see if you have any of those cases.
The solution if you do not is to name a module level variable
Dim Value
Dim Enabled
then compile
then delete them.
 
The solution if you do not is to name a module level variable
Dim Value
Dim Enabled
then compile
then delete them.

There was no module or variable called visible or enabled.
I followed the above step and now everything is in order. The properties show capitalized.

Thanks for sharing your experience.
 
Thanks for sharing your experience
Never seen it, just Googled it.
 

Users who are viewing this thread

Back
Top Bottom