I'm hoping someone can clear something up for me. I've only now been made aware of it, which is a bit of an embarrassment as I've been using it this way for years!
I've just discovered that when you use it on, say, the click event of a button that's intended to save the current record and close a form, it will raise an error (runtime error 2046 'the command or action 'saverecord' isn't available now').
When (under what circumstances) exactly can the following line of code be used?
I've also used the following to try and do the same thing with the same error message:
I know that closing a form (without using 'undo') will save the record anyway, but this does not seem right to me. So how exactly do I achieve what I want?
Thanks for any help.
I've just discovered that when you use it on, say, the click event of a button that's intended to save the current record and close a form, it will raise an error (runtime error 2046 'the command or action 'saverecord' isn't available now').
When (under what circumstances) exactly can the following line of code be used?
Code:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Code:
]DoCmd.RunCommand acCmdSave
RunCommand acCmdSaveRecord
Thanks for any help.