Saving a record

Ccook

Registered User.
Local time
Today, 21:34
Joined
Nov 30, 1999
Messages
10
In Access 97 I had a simple popup form bound to a table. It contains a Ticket Number and an Employee ID number. You enter the Ticket No. and select the employee.

I have a command button that allows you to print the Ticket report that is assigned to the Employee ID that was just entered. In Access 97 I simply saved the record before printing.

I used the following code:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 and then opened the report using the ticket number.

When I converted to Access2000, I get an error message that the save record option is not available when I try and print the report. I changed the code from what the wizard created to:
Docmd.RunCommand AcCmdSaveRecord.

And of course I get the same message because the save record option is not available on the menu.

Why is the save record option not available when this form is open?

Thanks in advance!
Cheryl :)
 
Cheryl,

Checkout the RunCommand method in VBA Online Help. I think the statement

RunCommand acCmdSaveRecord

will save your data.

Jim
 
RunCommand

Jim,

Thanks for your reply.

I am using the runcommand. That is when I get the error that the save option is not available. This form worked fine in Access 97, but not in 2000.

Cheryl
 
Cheryl,

Well, another rather less sophisticated approach :rolleyes: would be to try SendKeys "+~" (Shift-enter), which OUGHT to save the record....

Jim
 
Fixed

Somedays I think I am having a brain spasm!

I figured it out by creating another form and changing my options one by one to see when I would get the save error.

I had the edit records set to no. Duh! No wonder it would not let me save the record. Though Access 97 had no problem with this.

Thanks for your help Jim!

Cheryl
 
Cheryl,

Now you know why programmers all have flat spots on their foreheads from slapping them when the "doh" hits! :D

Jim
 

Users who are viewing this thread

Back
Top Bottom