Discussion Locked

Visual Basic variable name

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have on an Access 2000 form a combo box hight TransSexualism. When I write VB for the form, this variable appears as transsexualism, but from the results is obviously the same object. When I MsgBox transsexualism.name I get TransSexualism.
What is going on here?

5 replies

by ktirf

It is quite simple. The point is that Access's object names are case-insensitive. I.e. TransSexualism and transsexualism is the same name. Since you have set the name with capitals, transsexualism.name stores the name with capitals. But when you useit in VB code, it can appear both with and without capitals and it will be the same object. That's all. In short - nevermind the case of object names.

by ktirf

Well, in fact I'm amazed too. I have never seen VB decapitalizing names, it is something irregular.

by john_wills

I know that VB is case-insensitive, but up till now it has used the same letter cases as the form - indeed, capitals have been chosen by VB for other variables in my present form, according to my definition of those variables. In this instance, VB refuses to capitalize even when I make the capitalization explicit in the code.

by sl-campbell

This has to do with the auto correct feature of VB variable/object names, regardless of the scope.

You have ANOTHER Object, (combobox or something), with the same name, SOMEWHERE else, and it is spelled in lower case.

by john_wills

The idea that I have an object hight transsexualism and that this is the cause of the anomaly is contradicted by the fact that MsgBox transsexualism.name yields "TransSexualism": the one object seems to have two names.

This discussion is closed to new replies.