>In a form I type in a Number that represents a drawing number. Code activates and this number is searched for on a remote database and returns information accociated with the number. Also on the form are left and right navigation buttons. I want to use these buttons to go to the next drawing number on the remote database or previous drawing number. It is easy to add or subtract 1 from the current number and search again when all the drawing numbers are the same length. However, the drawing numbers very. I maight have 840000, 840001-401,840001-402,840002,840003-401,840003-403,840004-001,840005,840006 in a series of numbers. Do you see my problem? Localy I don't know what the next drawing number will be but I need the next one to display when I click the nav button. Thanks for the help.
If your DB supports the TOP N clause in the SQL, you could try:
select top 1 from mytable where drawing_number > current_number
Mark McCasland
Midlothian, TX USA