locked
using a loop counter variable in 'rs! & "x" & i' RRS feed

  • Question

  • I have a loop that parses thru a DAO record set.  The fields are X1,X2,X3,x...  what is the correct syntax for rs!xi where "i' is 1 thru 4?  the result should be rs!x1 for loop 1, rs!x2 for loop 2 and so on.
    Sunday, February 21, 2016 3:46 AM

Answers

  • Use   rs.Fields("x" & i)   or equivalently   rs("x" & i)

    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by Steve Staab Sunday, February 21, 2016 4:19 PM
    Sunday, February 21, 2016 9:58 AM

All replies

  • Use   rs.Fields("x" & i)   or equivalently   rs("x" & i)

    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by Steve Staab Sunday, February 21, 2016 4:19 PM
    Sunday, February 21, 2016 9:58 AM
  • Thanks much, that worked. I had tried rs!("x" & i) but the ! was the problem.
    Sunday, February 21, 2016 4:24 PM