In
Paul said:
I have been noticing that when I write a line such as 'Me.Trim()', the
editer converts the 'Trim()' function to lowercase when I move to
another line. For 'Me.SetFocus()', it converts 'SetFocus()' to
'setFocus()'. However, the 'Me' keyword is converted correctly if I
use all lowercase in both cases. I checked the object browser and
everything seems okay there and the code works fine. I am using
Access 2003 and Windows XP Pro SP2 on a corporate network. I've tried
this at home with Windows XP SP2 and Access 2002 and it works fine
there.
Usually that means you have defined some other function, variable, or
object with the differently capitalized version of the same name. Or
possibly they are defined in another library to which you have a
reference.
Conduct a thorough search for the offending object(s). If you can't
find them, it could be a residual autocorrection from some such object
that you used to have, but have since deleted. You may be able to get
it to go away by doing the following:
(a) Define your own global variables or procedures with the correctly
captialized names. Check whether all the mis-capitalized versions have
been corrected. If they haven't, do a global find and replace. Then
recompile your application, and see if things stay capitalized the way
they should. Then delete the global variables or procedures that you
created, recompile, and see if all is well now.
(b) If that doesn't work, try importing everything into a new database.
Do a global find and replace to fix the bad capitalizations, then
compile and see if all is well.
(c) If that doesn't work, try decompiling a copy of your database, then
doing a global find and replace, then recompile. Instructions for
decompiling follow my sig.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
HOW TO DECOMPILE AN ACCESS DATABASE
1. With the database closed -- no users in it at all -- and (ideally)
Access not running, make a backup copy.
2. On the task bar, click Start -> Run...
3. Enter this (adapted to match your database path and name) in the Run
dialog box and click OK:
msaccess.exe /decompile "C:\My Documents\YourDBName.mdb"
You may need to include the full path to msaccess.exe, but I don't find
that to be the case when I try it. Depending on your Access version,
you may not get any sign that anything in particular happened. Your
database will probably open in Access.
4. Compact and Repair your database.
5. Open the database again, press Alt+F11 to switch to the VB Editor,
and click Debug -> Compile (your project). If any errors appear, fix
them and recompile.
6. Close the VB Editor. Compact & Repair again.
See if the problem has disappeared.