VB control names

N

Nmidia

Dear all,

has anyone seen anything this weird before?

I have a set of check boxes on my main form.

chkLVRequired
chkCMRRequired
chkSAPRequired

these are all reffered to in VB. as you know, when VB understands the
control name, it auto populates it in code, and matches the case.
However, when i type chkSAPRequired it renames it to chkSAPrequied
(note the lowercase R in required). This is then causing my code to
fail.

I have tried the following to resolve this:

Repair/compact.
Recreate the check box control.
Rename the check box to chkSAPrequired.

however, none of this resolves the issue, the code does not seem to be
attaching itself to the control on the form.

I'm truely baffled!
 
A

Arvin Meyer [MVP]

Neither Window, nor Access is case sensitive by default, so it shouldn't be
causing your code to fail. Try using a Find and Replace from the Edit menu
in the VBA-IDE to replace all instances. You may also want to import
everything into a new empty database. (That will leave behind any residual
corruption).
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
L

Larry Daugherty

Could this be the dreaded NameAutoCorrect in action? What happens
when you turn NameAutoCorrect off?

HTH
 
N

Nmidia

forgive me, i've not seen this before. Could you explain. I've jsut
done a quick looka round, and from what I read, its access 2k onwards
isn't it? i should have mentioned, its Access 97. Sorry!
 
L

Larry Daugherty

You haven't given us much to go on. Try doing a Find on the term and
make it database wide. You may find that you've declared a variable
with the lower case "r:.

HTH
 
N

Nmidia

OK, will try that. I'm ready for sending my monitor out of the window
at the moment! Its really annoying! I'm not sure that I will have
named it as a variable somewhere as it uses my standard naming
conventions, but it is well worth a look. the odd thing is that it
works in other places. I'm going to "calmly" revisit my code today,
and play devils advocate to my methods, and see if there is something
wrong there. if it comes to it, apostrophe is my friend! 'i'll just
comment it out!
 
L

Larry Daugherty

You should have "Require variable declaration" true in your options.
That means that every module will have the line "Option Explicit" at
the top.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top