This code is part of ad hoc query maker, where the user selects items from a form and the SQL code is then generated. The ad hoc query maker works fine, even with multiple users. The problem came when it was requested that the produced query have the rows numbered, kind of like Excel. I tried...