Access 2000 - search button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I have a form with a number field "books". The numbers entered into this
field go up in 50's, eg 0030901, 0030951, 0031001 etc.

I need a search text box where I can type in say 0030905, or 0030916 etc and
a button when clicked on will display the record which is closest descending.

So if I typed 0030905 into the search text box and clicked on the button it
would go to the record where 0030901 is in the "books" field.

But if say I typed 0030962 into the search text box and clicked on the
button it would go to the record where 0030951 is in the "book" field.

Can this be done?

I am using Windows XP and Access 2000.

Many thanks for your help in advance.
 
Hi

You can set up a query that selects the TOP 1 based on what you type,
something like

SELECT TOP 1 books
FROM yourtablename
WHERE books <= forms!yourformname!books
ORDER BY books DESC

You could then use this query to be the data for a form

James
 
Back
Top