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

How to add record to be sorted First?

Status
Not open for further replies.

PCX

Technical User
Dec 17, 2000
54
0
0
US
Greetings,

I have a form that lists recordsets and need to allow the user to see the previous records (currently sorted newest to oldest). And allow them to enter a new record but have it show up at the top of the list instead of the bottom.

Each time I try to add a record, the new record is temporarily added to the bottom of the list.

Thanks
 
Can your users work upside down? (Just joking...). I have never seen this ability in Access. A new record is always added to the bottom. Then if your form is requeried, will pop to the top based on your sort order. You may consider to build a pop up form to be used only for adding new records. It could be "Modal" meaning users cannot leave it 'till finished, then, as it closes, it could requery your "main" form. Hope this gives you some ideas! Gord
ghubbell@total.net
 
Just curious but wouldn't something like
Code:
me.requery
as an afterupdate event do it?
I don't offer this as an answer, btw. Er, unless it works! :)

Mike
 
Working from Gord's solution (he gave me an idea) I did a mock-up of a continuous form with a reverse-chrono order query as the record source.

You still have to add records to the bottom of the form but if you put the requery in the form's AfterUpdate event the record will then pop to the top after the record goes in.
Code:
Private Sub Form_AfterUpdate()
    Me.Requery
End Sub

Just another variant.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top