Prosenjit Banerjee
New Member
- Joined
- Mar 19, 2002
- Messages
- 19
Dear Sir,
If I write a statement like the following:
var = False AND msgbox("ANDstORy")
or a statement like the following:
val = True OR msgbox("ANDstORy")
in each case the outcome is a MessageBox conting the given message.
My question is, is not it a but of VB/VBA handling with the AND and OR operators? Or am I going wrong? Please show me a light. Because in some cases I have no other way besides writing an If-Else ladder with so many indents. Even I am quite wondered to see that the Iif() function also does not work as expected. It works like the same as stated above. i.e. the following statement:
var = Iif(True, 1, msgbox("ANDstORy"))
also shows the MessageBox containing the the given messages. What is going on? If it is a but then why Microsoft is not going to rectify it? If I am going wrong then please explain why?
Thanks.
If I write a statement like the following:
var = False AND msgbox("ANDstORy")
or a statement like the following:
val = True OR msgbox("ANDstORy")
in each case the outcome is a MessageBox conting the given message.
My question is, is not it a but of VB/VBA handling with the AND and OR operators? Or am I going wrong? Please show me a light. Because in some cases I have no other way besides writing an If-Else ladder with so many indents. Even I am quite wondered to see that the Iif() function also does not work as expected. It works like the same as stated above. i.e. the following statement:
var = Iif(True, 1, msgbox("ANDstORy"))
also shows the MessageBox containing the the given messages. What is going on? If it is a but then why Microsoft is not going to rectify it? If I am going wrong then please explain why?
Thanks.