Connecting Tech Pros Worldwide Help | Site Map

Auto Capitalization in VBA Editor - WHY?

Corepaul
Guest
 
Posts: n/a
#1: Nov 12 '05

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
corepaulNoSpam@aol.com


Wayne Morgan
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Auto Capitalization in VBA Editor - WHY?


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" <corepaul@aol.combvwertz> wrote in message
news:20031022160728.08854.00000549@mb-m14.aol.com...[color=blue]
>
> 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[/color]
have[color=blue]
> 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[/color]
(it[color=blue]
> 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[/color]
only[color=blue]
> 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[/color]
doubt I[color=blue]
> missed any references.
>
> Everything seems to work OK so my question is not critical, but I WOULD[/color]
like to[color=blue]
> understand where and WHY the editor changes case (it does this in many[/color]
places,[color=blue]
> mostly for BASIC keywords).
>
> Are there any situations where case is critical?
>
> Any help in understanding this is appreciated.
>
> Paul Core
> corepaulNoSpam@aol.com
>
>[/color]


MGFoster
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Auto Capitalization in VBA Editor - WHY?


-----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:
[color=blue]
> 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
> corepaulNoSpam@aol.com
>
>[/color]

Corepaul
Guest
 
Posts: n/a
#4: Nov 12 '05

re: Auto Capitalization in VBA Editor - WHY?


[color=blue][color=green]
>>Subject: Auto Capitalization in VBA Editor - WHY?
>>From: corepaul@aol.combvwertz (Corepaul)
>>Date: 10/22/2003 3:07 PM Central Daylight Time
>>Message-id: <20031022160728.08854.00000549@mb-m14.aol.com>[/color][/color]

[color=blue][color=green]
>>I am new to Access 2000. My operating system is Windows 2000.[/color][/color]
[color=blue][color=green]
>>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[/color][/color]
[color=blue][color=green]
>>btnAlbumUp.SetFocus[/color][/color]
[color=blue][color=green]
>>to[/color][/color]
[color=blue][color=green]
>>btnAlbumUP.SetFocus[/color][/color]
[color=blue][color=green]
>>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).[/color][/color]
[color=blue][color=green]
>>Everything seems to work OK.
>>Paul Core
>>corepaulNoSpam@aol.com[/color][/color]


Subject: Re: Auto Capitalization in VBA Editor - WHY?
From: "Wayne Morgan" comprev_gothroughthenewsgroup@hotmail.com
Date: 10/22/2003 3:47 PM Central Daylight Time
Message-id: <c1Clb.13890$Oq2.3547@newssvr33.news.prodigy.com >
[color=blue]
>Try typing[/color]
[color=blue]
>Me.[/color]
[color=blue]
>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.[/color]
[color=blue]
>--
>Wayne Morgan[/color]

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
[color=blue]
>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: <qmElb.1375$wc3.522@newsread3.news.pas.earthlink.n et>[/color]
[color=blue]
>It's a peculiarity (mild bug/annoyance) in the VBA development
>environment. Sometimes compacting the project cures it.[/color]
[color=blue]
>The code is not case sensitive - so it doesn't matter much.[/color]

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


Wayne Morgan
Guest
 
Posts: n/a
#5: Nov 12 '05

re: Auto Capitalization in VBA Editor - WHY?


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


MGFoster
Guest
 
Posts: n/a
#6: Nov 12 '05

re: Auto Capitalization in VBA Editor - WHY?


-----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 > ...[color=blue]
> ... 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
>
>[/color]

Corepaul
Guest
 
Posts: n/a
#7: Nov 12 '05

re: Auto Capitalization in VBA Editor - WHY?


>- From the menu bar: Select Tools > Database Utilities > Compact[color=blue]
>Database.
>[/color]

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

Paul Core
Closed Thread