Results 1 to 6 of 6
  1. #1
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875

    Angry Why Does it Change the Case of Variables?

    Simply put, the Visual basic Editor is randomly deciding to change the case of my variable names!

    For example: If I type "strSONo" as a variable name (for "Sales Order Number"), the editor will change that to "strSoNo" as soon as I move off the line!

    How do I stop this!!?!

    And before you ask: No, I don't have it declared or used anywhere else. This is a brand new variable that I'm declaring and using for the first time (in this Module).

    Yes, I've had other variables with similar names (in other Modules) that don't get changed.

    Yes, I've tried turning off "Auto Syntax Check" in the editor Options.

    No, I haven't been able to figure out any rhyme or reason as to when it decides to do this: Sometimes it will change a variable name on me, and sometimes it won't!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you tried going from the Database window to:
    Tools>AutoCorrect Options...
    ...and playing a bit?

  3. #3
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Apparently the AutoCorrect Options menu wasn't introduced until sometime after Access 2000 :/

    Unfortunately, I'm forced to continue using Access 2000 because some of our workstations are pre-Win2k (Ugh, I know)!

    Additionally, the company won't shell out for anything new when what we have still works

    Also, in playing around (read: screaming threats and curses at my computer), I found that it SEEMS to be that I haven't Dim'd the variable yet. If I make sure to Dim a new variable it doesn't appear to have any problems with my case selections.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That is always a good practice in any event!

  5. #5
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Well, yeah. . .

    Sometimes though, I get stuck on something and end up making changes that need a new variable to work. So I just make the new variable and continue with coding.

    Then, when I've got everything how I want it, I add an "Option Explicit" to the beginning of my module and compile/Dim stuff until it works >.>

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Hmm...may have to alter your style just a bit then.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. VBA variables in SQL
    By compooper in forum Programming
    Replies: 3
    Last Post: 07-06-2011, 11:04 AM
  2. Print ONE particular case
    By lyndon.pace in forum Programming
    Replies: 2
    Last Post: 04-11-2011, 07:53 AM
  3. VBA in variables
    By smikkelsen in forum Access
    Replies: 3
    Last Post: 11-12-2010, 03:14 PM
  4. Use Case Scenarios
    By scott.weppler in forum Access
    Replies: 0
    Last Post: 05-31-2009, 12:15 PM
  5. sql in vb variables
    By emilylu3 in forum Programming
    Replies: 3
    Last Post: 03-04-2006, 01:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums