instr not reading character?
I have this string : "T(C)"
and if i call
If InStr(1, PnameBuf, "(") and InStr(1, PnameBuf, ")") Then
...
endif
it skips the if when pnamebuf = "T(C)"
why would this happen?
It also happens for "Or" instead of "and"
[270 byte] By [
chupacabra] at [2007-11-11 10:09:13]

# 1 Re: instr not reading character?
because logicaly 2 AND 5 = 0 'false !
but with "or" the if must be entred try again !
Amahdy at 2007-11-11 17:23:14 >

# 3 Re: instr not reading character?
well of course you know that AND in if is differnt from or so u may need some thing like that :
if InStr() ...
if InSTr() ...
.
.
.
end if
end if
Amahdy at 2007-11-11 17:25:15 >

# 4 Re: instr not reading character?
well of course you know that AND in if is differnt from or so u may need some thing like that :
if InStr() ...
if InSTr() ...
.
.
.
end if
end if
would this not work adequately?
If InStr(1, PnameBuf, "(") <> 0 And InStr(1, PnameBuf, ")") <> 0 Then
I only put the "or" to try to make it work correctly. it should be an "and"
# 5 Re: instr not reading character?
yea and best than the nested if just i thinked that u need it by this method "if(expresion)" .
p.s : update your signature : Micro$oft access 2007 :) .
Amahdy at 2007-11-11 17:27:19 >
