Mangler wrote:
Still not having luck here......
With the understanding that false = true and true = false I have this:
If spDupresult = "YES" Then
MM_abortEdit = false
Else
If MM_abortEdit = true Then
' execute the insert
Got any more suggestions?
I'm not sure you saw my point. In your example, you never show what
the initial value of MM_abortEdit is. If it is Null, then consider the
following:
Sub WrongWay(spDupresult)
Dim MM_abortEdit
MM_abortEdit = Null
If spDupresult = "YES" Then MM_abortEdit = True
Response.Write(MM_abortEdit & ":" & Not MM_abortEdit)
If MM_abortEdit Then Response.Write(":Yes")
If Not MM_abortEdit Then Response.Write(":No")
Sub
Sub RightWay(spDupresult)
Dim MM_abortEdit
If spDupresult = "YES" Then
MM_abortEdit = True
Else
MM_abortEdit = False
End If
Response.Write(MM_abortEdit & ":" & Not MM_abortEdit)
If MM_abortEdit Then Response.Write(":Yes")
If Not MM_abortEdit Then Response.Write(":No")
Sub
Call WrongWay("YES") ' True:False:Yes
Call WrongWay("NO") ' :
Call RightWay("YES") ' True:False:Yes
Call RightWay("NO") ' False:True:No
As you can see, your code example "fits" the WrongWay model. You assigned
one possible boolean value (True), but then tested for (Not False), never
considering that there might be a (Not Null) alternative that does nothing.
It is worth asking why you don't simply use the inequality operator directly
and skip the extra variable:
If spDupresult <"YES" Then
' execute the insert
...
End If
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.