FindAndReplace String - Error

D

Dirk Goldgar

In
Curtis Stevens said:
I'm getting an error, anyone know why or need more info?

Using Access 2002

ScreenShot of error: www.gotmerchant.com/help.gif

The odd capitalization of "MID" -- the function should be recognized and
capitalized as "Mid" -- leads me to believe you have some other
definition of MID that is in scope at the same time. Search your
project for "MID", with that exact case.
 
C

Curtis Stevens

I tried to do Mid, but access automatically changed to MID.

I don't have MID anywhere else.

Thanks
Curtis
 
D

Dirk Goldgar

In
Curtis Stevens said:
I tried to do Mid, but access automatically changed to MID.

I don't have MID anywhere else.

Did you have, at some previous time? There must be some reason the VB
Editor thinks it should be capitalized that way. What happens if you
right-click on the word "MID" in the statement and choose Definition in
the context menu?
 
C

Curtis Stevens

I have a field name MID in my main table. Is that what you mean, reference,
forgot about that field being named that. Is that the issue? Access is
automatically Cap. the MID so not allowing it to work? In other words, Mid
will work, but not MID?

Thanks
Curtis
 
D

Dirk Goldgar

In
Curtis Stevens said:
I have a field name MID in my main table. Is that what you mean,
reference, forgot about that field being named that. Is that the
issue? Access is automatically Cap. the MID so not allowing it to
work? In other words, Mid will work, but not MID?

I'm not sure, but I think the problem is that Access *thinks* your use
of the word "mid" is a reference to the field named "MID". If that's
so, then as long as Access thinks that, it's not going to work. The
question is, is Access terminally confused, or is the field named "MID"
in the naming scope at the time this code is being executed? Where is
this code located? Is it behind a form bound to that table? Is it in a
standard module?

I could also be barking up the wrong tree here, but that's all I can
visually see that's fishy about your code. Since you posted it only as
an image, I can't paste it into a test module and see if there's
something I overlooked. I don't feel like typing it all in.
 
Top