473,396 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Auto Capitalization in VBA Editor - WHY?


I am new to Access 2000. My operating system is Windows 2000.

In the early stage of development I noticed something weird. On my form, I have
a Command Button named "btnAlbumUp". The first time that I reference this
button in VBA code, the Visual Basic Editor capitalizes the P changing

btnAlbumUp.SetFocus

to

btnAlbumUP.SetFocus

I double checked that the control was defined on the form with a small p (it
was). I did a Edit/Find search for "btnAlbum" and confirmed that I hadn't
mistyped the name somewhere else in the VBA code (this is the first and only
reference to this control in VBA code). I am in the very early stages of
development and do not have much code for the problem to hide in so I doubt I
missed any references.

Everything seems to work OK so my question is not critical, but I WOULD like to
understand where and WHY the editor changes case (it does this in many places,
mostly for BASIC keywords).

Are there any situations where case is critical?

Any help in understanding this is appreciated.

Paul Core
co************@aol.com
Nov 12 '05 #1
6 10181
Try typing

Me.

in the form's code module. When you hit the period, it should give you a
list of available commands, including the controls on the form. Scroll down
this list, how does it show the capitalization? If it doesn't show the
capital P and if you use the Me. in front of the control name, does it still
capitalize the P? If not, then it is getting it from something somewhere
else in the database.

--
Wayne Morgan
"Corepaul" <co******@aol.combvwertz> wrote in message
news:20***************************@mb-m14.aol.com...

I am new to Access 2000. My operating system is Windows 2000.

In the early stage of development I noticed something weird. On my form, I have a Command Button named "btnAlbumUp". The first time that I reference this
button in VBA code, the Visual Basic Editor capitalizes the P changing

btnAlbumUp.SetFocus

to

btnAlbumUP.SetFocus

I double checked that the control was defined on the form with a small p (it was). I did a Edit/Find search for "btnAlbum" and confirmed that I hadn't
mistyped the name somewhere else in the VBA code (this is the first and only reference to this control in VBA code). I am in the very early stages of
development and do not have much code for the problem to hide in so I doubt I missed any references.

Everything seems to work OK so my question is not critical, but I WOULD like to understand where and WHY the editor changes case (it does this in many places, mostly for BASIC keywords).

Are there any situations where case is critical?

Any help in understanding this is appreciated.

Paul Core
co************@aol.com

Nov 12 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It's a peculiarity (mild bug/annoyance) in the VBA development
environment. Sometimes compacting the project cures it.

The code is not case sensitive - so it doesn't matter much.

- --
MGFoster:::mgf
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP5cSHYechKqOuFEgEQIxmQCfaCWxaWYx2PEjHv0UV6atRc GZ9FYAn0ay
q/gZmL1ApO9E0r+fRGddevgw
=yJzd
-----END PGP SIGNATURE-----

Corepaul wrote:
I am new to Access 2000. My operating system is Windows 2000.

In the early stage of development I noticed something weird. On my form, I have
a Command Button named "btnAlbumUp". The first time that I reference this
button in VBA code, the Visual Basic Editor capitalizes the P changing

btnAlbumUp.SetFocus

to

btnAlbumUP.SetFocus

I double checked that the control was defined on the form with a small p (it
was). I did a Edit/Find search for "btnAlbum" and confirmed that I hadn't
mistyped the name somewhere else in the VBA code (this is the first and only
reference to this control in VBA code). I am in the very early stages of
development and do not have much code for the problem to hide in so I doubt I
missed any references.

Everything seems to work OK so my question is not critical, but I WOULD like to
understand where and WHY the editor changes case (it does this in many places,
mostly for BASIC keywords).

Are there any situations where case is critical?

Any help in understanding this is appreciated.

Paul Core
co************@aol.com


Nov 12 '05 #3
Subject: Auto Capitalization in VBA Editor - WHY?
From: co******@aol.combvwertz (Corepaul)
Date: 10/22/2003 3:07 PM Central Daylight Time
Message-id: <20***************************@mb-m14.aol.com>
I am new to Access 2000. My operating system is Windows 2000. I have a Command Button named "btnAlbumUp". The first time that I
reference this button in VBA code, the Visual Basic Editor capitalizes
the P changing btnAlbumUp.SetFocus to btnAlbumUP.SetFocus I double checked that the control was defined on the form with a small p (it
was). I did a Edit/Find search for "btnAlbum" and confirmed that I hadn't
mistyped the name somewhere else in the VBA code (this is the first and only
reference to this control in VBA code). Everything seems to work OK.
Paul Core
co************@aol.com


Subject: Re: Auto Capitalization in VBA Editor - WHY?
From: "Wayne Morgan" co***************************@hotmail.com
Date: 10/22/2003 3:47 PM Central Daylight Time
Message-id: <c1******************@newssvr33.news.prodigy.com >
Try typing Me. in the form's code module. When you hit the period, it should give you a
list of available commands, including the controls on the form. Scroll down
this list, how does it show the capitalization? If it doesn't show the
capital P and if you use the Me. in front of the control name, does it still
capitalize the P? If not, then it is getting it from something somewhere
else in the database. --
Wayne Morgan
Adding the self-reference explicitly (Me.btnAlbumUP.Set Focus ) did not help.
When I looked at the list of controls as you suggest, it is spelled btnAlbumUP,
even though it is spelled with a small p in the objects list in the form design
view.
Paul Core
Subject: Re: Auto Capitalization in VBA Editor - WHY?
From: MGFoster me@privacy.com
Date: 10/22/2003 6:26 PM Central Daylight Time
Message-id: <qm****************@newsread3.news.pas.earthlink.n et> It's a peculiarity (mild bug/annoyance) in the VBA development
environment. Sometimes compacting the project cures it. The code is not case sensitive - so it doesn't matter much.


I am an amateur programmer working by myself on personal projects. Small
projects compared with commercial efforts. Anyway, I never compacted a project.
I tried completely removing the control and ALL references to it, saving the
project, and reinstalling the control being VERY careful to use a small p the
first time, and every other time, the control name is entered. The behavior did
NOT change (small p in design view, cap P in VB code).
You are correct that it does not affect performance, the program runs fine.
When I see something I don't understand, I can't help thinking about it. Excuse
my quixotic pursuit, but I would like to test whether or not removing the
control and then compacting the project before reinserting the control will
work. However, I am afraid to try it without advice from someone who has done
this before.

What are the steps to compact a project?
Are there any potential problems I should watch for? Any hints not easily found
in the on-line help?
Under what other conditions should a project be compacted?
Thanks for the comments.

Paul Core
Nov 12 '05 #4
Compacting a database is routine maintenance. The database size will grow from use and the
only way to recover the wasted space is to compact the database. Access 2000 and newer
combined repairing and compacting into a single command. Go to Tools|Database Utilities on
the menu bar and click Compact and Repair Database... The database will close momentarily
while Access compacts it, then it will reopen.

--
Wayne Morgan
Microsoft Access MVP
Nov 12 '05 #5
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- From the menu bar: Select Tools > Database Utilities > Compact
Database.

Compact the file every-now-and-then to reduce its file size, reset
AutoNumbers and get rid of "ghost" objects (objects that have been
deleted, but not yet removed from the database file).

HTH,

MGFoster:::mgf
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP5jCaYechKqOuFEgEQIq9ACeNYN8VYYpvHTcJz4Vain7Ip fmQHwAoJJi
cQklvLLWJEVpqgGTDs8teyxI
=5Mzl
-----END PGP SIGNATURE-----

< SNIP > ...
... compacting the project before reinserting the control will
work. However, I am afraid to try it without advice from someone who has done
this before.

What are the steps to compact a project?
Are there any potential problems I should watch for? Any hints not easily found
in the on-line help?
Under what other conditions should a project be compacted?
Thanks for the comments.

Paul Core


Nov 12 '05 #6
>- From the menu bar: Select Tools > Database Utilities > Compact
Database.


Sounds easy enough. Thanks to Wayne Morgan and MG Foster for your patient help.

Paul Core
Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Seth | last post by:
How can I completely turn off the auto formatting of Html in Visual Studio 7? I have tried all possible combinations (at least I think I have) of the Tools / Options / Text Editor / HTML XML /...
0
by: Agoston Bejo | last post by:
Tools / Options / Text Editor / HTML/XML / Format / Capitalization Usually I use Tags: Uppercase; Attributes: Uppercase but now I edit XML pages and I set them both to "As entered". However,...
3
by: Robin Tucker | last post by:
Hi there, I have this really frustrating problem with Visual Studio (Microsoft Visual Basic .NET 2003 69586-335-0000007-18843). I have got used to using the autocomplete and auto indent...
7
by: Aaron | last post by:
I like some of the auto-formatting features of VB.NET (god help me) but I really prefer to use CSharp (C#) is there any way to get the features of auto-indenting, auto-capitalization, and advanced...
6
by: David P. Donahue | last post by:
I've always used VB in Visual Studio and have just started porting some of my stuff to C#, but I'm noticing something odd in Visual Studio (2003, if that's important). When writing VB code, the...
5
by: Brakeshoe | last post by:
I would like to find out how to turn on the Auto Complete variable names feature while editing source code in Visual Studio. It seems to appear on intermittantly, and when it does the variable...
2
by: John Holmes | last post by:
I saw a similar post that went unanswered about a month ago. I am annoyed by the auto-formatting that occurs when creating my form. I'll make changes to the code (HTML tab) and then view them in...
3
by: Tim | last post by:
I just bought VS .Net, and am getting up to speed. One thing I can't find, though, is how to get the editor to automatically capitalize keywords (Public, As, Imports, etc.), the way the VB 6.0...
1
DebadattaMishra
by: DebadattaMishra | last post by:
Introduction In case of rich applications, you must have observed that a text field behaves like a dynamic combo box. When the user enters some characters in the text field, a popup will come up...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.