Data entry method

twychopen22

Registered User.
Local time
Today, 07:04
Joined
Jul 31, 2006
Messages
101
I want to have my records in my form show the latest entry, not a completely new form. The user will click on the new record button to create a new record but I want the user to be able to see the last record. Anybody know how to do this?
 
Well, you can use this in your form's Open event:

Code:
DoCmd.RunCommand MoveRecordGoToLast
(this is off the top of my head)

Be advised that it may significantly slow down your database if you're not filtering the record source to a managable size.
 
Just a word of caution, moving to the last record doesn't necessarily mean that it's moving to the last record added. Unless you have a way of determining the last record added (date, your own incremental number, etc.) you are not assured of getting the actual last record entered.

Sometimes the recordset just happens to get the last record entered, but since the table is not stored in "first-to-last" order, there is quite the possibility that you will just get the last record in the recordset.

If you really want the last record added, find a way to pull your form's recordset so that sorting is based on a field that would identify the last record added.
 
Well the records are sorted by date. Each day new records get inserted, so they are sequential...Will this (Previous post) work the correct way? I want it to show yesterday's additions every day I go into the forms. Thanks for ya'lls help
 
Code:
DoCmd.RunCommand MoveRecordGoToLast

Does anybody know what the exact is? I am looking and not finding

Found it

Code:
DoCmd.GotoRecord, , acLast
 
Last edited:
As I said, that was off the top of my head. The correct syntax should be

Code:
DoCmd.RunCommand [b]acCmd[/b]MoveRecordsGoToLast
 
From a perspective of being user-friendly, the strategy I would use is this:

All the user to find the last record. But put a button on the form to enter a new record if that is what you want to do. Put a separate button on the form to allow editing of the current record if THAT is what you want to do and it is allowed.
 
ok..i made a mistake, that last code is not working for me. Geez this database it just killing me.
Code:
DoCmd.RunCommand acCmdMoveRecordsGoToLast
is what I have, I do like the idea of dif. buttons tho
 
I had a similar need. What I did was split the form into a data entry section with a subform (datasheet view) that displayed all recent entries. However, I was having trouble getting the subform to update (show the last record) when the update "button" was pressed. I have not yet gone back to fix this, but I think the command: ME.REFRESH may solve that problem.
 
ortaias,
Not gonna lie, I have been trying to figure out how to do that datasheet view thing with subforms (be able to change view from lists of records to data entry etc. And haven't ever known how until u said that. I have been working w/access for over a year now.:eek: Man I'm Dumb!!!!:p
 
my boss told me to do this or I would be fired. He likes emoticons he says! :confused: :) :eek: :cool: :rolleyes: :mad: :p ;) :D :(
 
my boss told me to do this or I would be fired. He likes emoticons he says! :confused: :) :eek: :cool: :rolleyes: :mad: :p ;) :D :(
 
Did it work? I never went back to fix. Access has a very steep learing curve.
 
I didn't do the refreshthing but the last code that I had worked like a charm!
 

Users who are viewing this thread

Back
Top Bottom