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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Records in a form

Status
Not open for further replies.

skaurd

Technical User
Jun 4, 2002
51
GB
I have a form which has numerous records sorted by year. How do I change it so that year is descending and the new record row appears that the top instead of at the bottom?

thanks

S
 
To set the sort order on your continuous form, on the on open event of that form include the following code:

Forms!yourformname.orderbyon = true
Forms!yourformname.orderby = “yourdatename”,DESC

That will control the order of records displayed.

As to your second question, Access defaults to the bottom of a continuous form to add records. Someone may be able to give you a trick, or technique to add a new record from the top of your list.

My approach, is to place an add button in the form footer of the continuous form which will bring up a new cleanly designed data input form while leaving the continuous form on the screen. On the close event of the add record form, I requery the continuous form which will now show all the records on the continuous form in correct order.

Just my $0.02 worth.
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
For the control source of the form
Click on the elipse to generate a query for the form and tell it to sort decending on date
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top