Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to put step-down and up arrow?

Status
Not open for further replies.

airbase

Technical User
Jan 30, 2002
21
CN
you have a database taht stores car details, but it stoores upto 100 records for each year of car that is searched for : e.g. search for year 6and 32 records appear.

i would like to know how to put a search box with step up(car years) arrow and step down arrow to allow users to click instead of type.
 
I presume you already have a query that returns the cars for each year, depending on the year chosen? If so, I usually find it is easiest (not necessarily best practice) to have a hidden text box with the value in it that is to decide the records returned.

For instance, place a text box on the form called, say, txtYearOfMake. You can set it with a default value or, if you want say the current year to come up by default, set the default to Year(Now()).

Then, have the form's record source set to the query and set put in the YearOfMake field (or whatever your equivalent is) the criteria "Like [Forms]![FormName]![txtYearOfMake]". Then add two buttons for up and down. For example, in the up button's OnClick event, put "txtYearOfMake=txtYearOfMake +1", then FromName.requery to requery the form and the query. This should update the records shown.

This is the principle of it anyway, if not very well explained by me. Have fun! :eek:)

Alex Middleton
 
thank you!
Alex,it works well!
Shelly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top