Here&#039;s the deal, I&#039;m trying to make an emarketplace for restaurants and their what our group wants is that when you order, the order form page would generate an order form code that is customized for different restaurants...for example, restaurant A would have this format for his OrderFormCode ABCDEFG1, while restaurant B can have this format, ASDFGHJ1... so for every order form generated, by that restaurant, only the number would change as it would the next time restaurant A orders, the OrderFormCode would be ABCDEFG2 and so on... <BR><BR>What I did... <BR><BR>In my database I made a table named OrderForm where general details are within the table...In this table as well, there are two columns namely OrderFormCode and OrderFormID...the OrderFormCode represents the alphabetical part of the code, in restaurant A&#039;s case its &#039;ABCDEFG&#039;, while the OrderFormID represents the numerical part... <BR><BR>To automatically generate the OrderFormCode and the OrderFormID here&#039;s the code I wrote: <BR><BR>GenOrderIDSQL = "SELECT * FROM EMOrderForm WHERE EMOrderForm.Restaurant_Id = " & Session("Log2b_Id") & "" <BR><BR>Set CheckID = chowDB.execute(GenOrderIDSQL) <BR> <BR>CheckID.MoveFirst <BR>While NOT CheckID.EOF <BR> Code = CheckID("OrderForm_Code").value <BR> number = CheckID("OrderForm_Id").value <BR>Wend <BR><BR>number = number + 1 <BR><BR>After this, I would just add Code and number in my database for the columns OrderFormCode and OrderFormID, respectively... <BR><BR>Now the problem is, whenever I execute this, I seem to get an endless loop...because the page it supposedly would proceed to after the execution does not open with the operation timing out... <BR><BR>What&#039;s wrong with my code? What other way can I use to perform this task? <BR><BR>Your inputs would be gladly appreciated! <BR>