Hello,

I have a strange problem. I have written the following code to insert details into my database the user can enter a quantity and the routine will run until
the vairable check = the vairable quantity.

now what is wierd is that it works fine but one it has entered record 2084, 2184, 2284 (anything ending in 84 basically) it stops working.
It stops returning the last value in the serial number field, it returns the previous and therefore wont insert into the database anymore as it will create a duplicate value in the primary key!

can anyone thing what is making it screw up?????

here's my code..........

PHP Code:
Dim last As Integer

        Dim SerialNo 
As Integer

        Dim check 
As Integer 0

        
Do Until check qty

            check 
check 1

            DT8000 
DB.GetTable("Select Last (serialNo) From Shipped")

            
DR8000 DT8000.Rows(0)

            
last DR8000("expr1000")

            
SerialNo last 1

            DB
.Insert("insert into Shipped (serialNo, Family, Model, SDate)   Values (" serialNo ", '" Family "', '" model "', '" Year "') "))

        
Loop 
any help will be much appreciated, i am baffled!

cheers,

Iain