value did not clean out at next round in loop

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cschang

    value did not clean out at next round in loop

    I looped a record set to display and I found a strnage thing. as

    Do While NOT rsBinAct.EOF

    l_bin = rsBinAct.Fields ("o_bin")
    l_niin = rsBinAct.Fields ("o_bin_niin ")
    l_b = LEFT(l_niin, 3)
    l_n = RIGHT(l_niin, LEN(l_niin)-3 )

    ' display l_bin, l_b, l_n in a table-like page

    rsBinAct.MoveNe xt
    Loop

    If I do not set the l_b and l_n to NULL then if the next l_niin is null
    value, I will get the l_n value of previous one only, l_b is still null.
    I wonder why.

    C Chang

  • Rob Meade

    #2
    Re: value did not clean out at next round in loop

    "cschang" wrote ...
    [color=blue]
    > If I do not set the l_b and l_n to NULL then if the next l_niin is null
    > value, I will get the l_n value of previous one only, l_b is still null.
    > I wonder why.[/color]

    Because you haven't overwriten the value, you cannot get a LEFT of null
    value - infact I'm surprised that this didnt error?

    Why not just clear the variables out after you've displayed them ready for
    the next iteration just to be sure?

    Regards

    Rob


    Comment

    Working...