Save command not available... why?

Carl_R

Registered User.
Local time
Today, 02:54
Joined
Aug 16, 2002
Messages
82
Access97:
I have a form with a date field. After the date is entered I run a DoCmd.RunCommand acCmdSave and then a requery. The form does not close but stays open for the user to perform another action.

My problem is this:

When I test the .MDB (no split - just a straight .MDB), no errors occur.

As soon as I split the DB into frontend(.MDE) and backend(.MDB) I receive an error that 'the save command is not currently available' (I am the only person using the DB).

Actually, I click ok and everything is fine - the save is done and the requery runs.

What gives? Why do I get this error message in the .MDE but not the original .MDB? In fact, why do I get it at all.

I could trap the error but I really want to understand what is happening.
 
Try DoCmd.RunCommand acCmdSaveRecord.
When you split the Db you need to write the record back to the table (which is now on the BE)

I have found the "save command is not currently available" message is caused by having the focus on a command button or something other than the field (How do you save a button?)
HTH
Dave
 
OldSoftBoss

Excellent :) That did the trick.

So what is the difference between acCmdSave and acCmdSaveRecord?
 
Carl_R said:
OldSoftBoss

Excellent :) That did the trick.

So what is the difference between acCmdSave and acCmdSaveRecord?

acCmdSave saves an object...for instance you could do the following:

Code:
DoCmd.OpenReport "report", acViewDesign
    DoCmd.RunCommand acCmdReportHdrFtr
    DoCmd.RunCommand acCmdSave
    DoCmd.RunCommand acCmdCloseWindow

This opens a report, "report", and adds a header and a footer dynamically and then saves the object.

In your case a record has become "dirty" and needs to be saved. On a continous form you will notice this on a record selector. The record selector shows a little pencil when its being modified. To ensure that the record is saved you use acCmdSaveRecord.

Jon
 

Users who are viewing this thread

Back
Top Bottom