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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command or action Save Record isn't available now? 2

Status
Not open for further replies.

ApparentlyInept

Technical User
Mar 13, 2005
25
US
Runtime Error 2046
The Command or action Save Record isn't available now.

Anybody know why this error might be coming up? I have it set as a OnClose event.

When I go to debug it highlights the entire DoCmd action.
Code:
Private Sub Form_Close()

[highlight]DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70[/highlight]

End Sub
 
Change it to this
Code:
Private Sub Form_Close()
If Me.Dirty = True Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
End If
End Sub
Also have a Search on these forums

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

Part and Inventory Search

Sponsor

Back
Top