473,324 Members | 2,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Save does not stay on current record in access 2007

I have a command button on a simple form created with the wizard. When adding a new record and the clicking save it does not stay on the current record.
I have also tried an event procedure with the code:
docmd.runcommand acCmdSaveRecord
Sep 28 '11 #1
3 4211
jimatqsi
1,271 Expert 1GB
Nancy,
Are you using a continuous form? How do you know it does not stay on the saved record?

Please show us the code in the click event of your command button. I think there is more than the one line of code you shared.

Jim
Sep 28 '11 #2
The record source is sorted alpha by client last name.
It leaves the current client and goes to last record

It is an embedded Macro (automatically created in 2007)
Action: runcommand
Arugments: SaveRecord

There is another posting very similar on your website that states this is a bug with microsoft.

I have a work around by changing the sort on the record ID so it is on the last record and after saving it stays on the last record. But they prefer to have the data sorted alphabetically.
Sep 29 '11 #3
jimatqsi
1,271 Expert 1GB
Well, seems to me it actually makes sense what it is doing. There is no current record, you are creating a new record.

If you go edit that record, or any other record, when you save it the current record will remain the current record.

This might help. After the save add this code:
Expand|Select|Wrap|Line Numbers
  1. me.bookmark = me.lastmodified 
That should move it to the record you just added.

or if you want to return to the record you were on before you hit the add new record button:
Expand|Select|Wrap|Line Numbers
  1. dim bkm as string
  2. bkm = me.bookmark
  3. (code to add new record here )
  4. me.bookmark = bkm  ' returns to the record you were at before the new record add
  5.  
Jim
Sep 30 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Colin Graham | last post by:
I am writing this piece of code to show the previous record on a control on the form but i keep getting the error message "Error 3021 no current record " and the line marked *** gets highlighted. I...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
8
by: jdvon | last post by:
I have downloaded a neat MS Access 2007 template which has some extra functionalities. The "save as" option in MS Access 2007 for saving as 2002 format generates a message saying the file cannot be...
16
by: google | last post by:
In a continuous form the following code is under a button in the form header. In Access 2003 and earlier, this goes to a new record, then adds relevant data to that new record. DoCmd.GoToRecord...
3
by: Kalaine | last post by:
Access 2003: The following code is intended to delete the current record and all child records but results in an error, help please, thx. Private Sub CmdDelBSR_Click() On Error GoTo...
1
by: blademike | last post by:
Hi guys, I'm new to Access & SQL. Currently using Access 2007. What I have: 1) Table: Employee( empID, empName, email, pwd, ... ) 2) Form: - Record source ( SELECT empName, email, pwd FROM...
2
by: Ian | last post by:
I am trying to save the current record on a form before opening a report, doesn’t sound to hard does it? The code on a buttons on click event goes like this: DoCmd.DoMenuItem acFormBar,...
0
by: News Lantic moenie del | last post by:
Hi How can I disable the close button in access 2007. Reason I want to force a backup on exit and now I can't. The code for Access 2003 to disable close button does not work in Access 2007 Thanks...
7
Fritz G
by: Fritz G | last post by:
Hi I have a simple one table, one form MS Access 2007 DB. I want to have the data entry person verify their changes to a record before closing the form or moving to the next record only if any...
4
by: simulationguy | last post by:
I inherited an Access 2003 database runs fine in 2003 but in 2007 I get an error on updating a form. Record Not available on the last statement !ItemNumber.SetFocus Does anyone know why...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.