Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-Time Error '2046'"

Status
Not open for further replies.

greeneyerat

Technical User
Oct 15, 2003
26
0
0
US
Hi,

I have a command button on a form, that when clicked an "appointment" form should appear. All the form is for is to enter information pertinent to an appointment and it sends it to MS Outlook Calendar.

It was working fine yesterday, I did not change the code. I have other forms with the same command button, and on click it works fine.

Following is the error I get:

Run-time Error '2046' The command or action "Save Record' isn't available now.

Following is the line of code that is highlighted:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

 
greeneyerat

Did you enter data for all required information? When designing a database, the developer will / may design the table(s) to ensure data integrity. If important information is missing, the rules for saving the record are broken which will generate an error.

Does this button now always cause a problem, or just the one-time?

Richard
 
Your record must have saved before you click the command button.
You can change your code to something with
[tt]
If Me.Dirty Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Else
'Do what ever..
End If
[/tt]
hope this helps

Zameer Abdulla
[sub]Jack of Visual Basic Programming, Master in Dining & Sleeping[/sub]
Visit Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top