By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,827 Members | 2,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,827 IT Pros & Developers. It's quick & easy.

Auto Capitalization in VBA Editor - WHY?

P: n/a

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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
-----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

P: n/a
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

P: n/a
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

P: n/a
-----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

P: n/a
>- 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 discussion thread is closed

Replies have been disabled for this discussion.