New record at top of list

suepowell

Registered User.
Local time
Today, 16:51
Joined
Mar 25, 2003
Messages
282
Hi,

Does anyone know if it is possible to have the new record at the top of a continuous form, rather than at the bottom.

My client would like the form ordered with latest at the top (that's fine), but doesn't then want to go to the bottom of the list, which could be hugh, to add a new record.

Is this possible and if so does anyone know how.

I am working in Access 2007 in case that hepls.

Sue
 
Hi Sue...I was just about to post this exact question :) if you work it out could you post your solution as I will do ...cheers Fi
 
Display your records in Descending order. Go into the Form's Code Module under the OnOpen event and enter something like this:

Me.OrderBy = "[Customer ID] DESC"
Me.OrderByOn = True


In this example the form is sorted based on the Table field Customer ID and the DESC added in the string tells Access to sort the records in Descending order. You can use this method to sort by any table field. If you want to to display the last record entered, then you would want to use he Field that contains the AutoNumber.

.
 
HI Cyberlynx,

Thanks for your reply.

I know I can order the records by whichever field, and which ever order I like, I am happy doing this, but what I want to know is how I get the blank new record I am going to type a new entry in to appear at the top of the list not at the bottom.

If I order by date descending then the latest appears at the top of the list but I have to go to the bottom to add a new record. I want that add a new record line to appear at the top above the last record entered.

I seem to think it's not possible, but I am hoping someone can prove me wrong.

Thanks

Sue
 
uhhhh.....I see now and the answer to the best of my knowledge is No but, you can simulate the effect. It's far better to talk your client out of this idea.

.
 
Hi...been reading various threads and it sounds like it would only be possible with a lot of code and unbound forms (Rich in 2005 so perhaps that has changed), I have used the code below not ideal but at least gets the focus on the last record when the subform opens, it that helps

Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acLast
End Sub

cheers Fi
 
I don't have access to experts-exchange but I would guess you could just create two subforms. The first subform would just be for additions and one line only (with a bit of code). The second subform below it would be your current data. This would simulate the effect.
Chris
 
Why not have a popup form appear if the user selects to add a new record? This would look more professional and could be validated more precisely. Then when you save and close the form it would appear at the top of the list. The user does not have to worry about navigation at all.

You could also put a vbYesNo MsgBox on the button "Are you sure you want to add a new record?" to ensure that the user has not clicked the button by mistake. Don't want to be concerned about empty rows, do we?

David
 
I never find the answer to this question, seems impossible to me but I use the following workaround: In the double click event of the combo box, put the code

Private Sub NameOfComboBox_DblClick(Cancel As Integer)
DoCmd.GoToRecord Record:=acNewRec
End Sub

And that's all! You double click on either record of the combo list and get quickly at the new record
 

Users who are viewing this thread

Back
Top Bottom