SaveRecord not working in Access2002

H

Helen

I've just converted an Access 97 database to 2002 and all
the commands:

DoCmd.DoMenuItem A_FORMBAR, A_FILE, A_SAVERECORD, ,
A_MENU_VER20

does not work. It keeps saying the command or option
SaveRecord isn't available now. What has changed between
the 2 versions? Any 'speedy' help would be greatly
appreciated.
 
G

GVaught

I believe the A part has been replaced with AC . Open the code editor window
and open the object browser. I believe what you want is accloseSave. Access
97 used Access Basic. Access 2000 and above moved to VBA, a form of Visual
Basic.
 
G

GVaught

Added thought:
Something else you could try without having to replace the old code with the
new code is change the references it uses. Access 2000 and above default to
ADO and not DAO that 97 used. Make sure your references indicate DAO 3.6 is
being used and not ADO 2.1. This may allow your existing code to operate.
However, be aware that future versions of Access may eliminate the backwards
compatibility and the sooner you upgrade your existing code, the better.
 
G

Gary Walter

Hi Helen,

I believe this is what G was referring to:

DoCmd.RunCommand acCmdSaveRecord

some use additional code in a form:

If Len(Me.RecordSource) > 0 Then
If Me.Dirty Then
DoCmd.RunCommand acCmdSaveRecord
End If
End If

or just

If Me.Dirty Then
DoCmd.RunCommand acCmdSaveRecord
End If

Good luck,

Gary Walter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top