Run time error "2486"

adi32

Registered User.
Local time
Today, 14:03
Joined
Dec 6, 2000
Messages
82
Hello,
I have a form (orders) with 1 subform.(products) (access2k)
I add a new order and I go to the first product I fill in it and when I press TAB to go the the second
I get the error message: <Run time
error "2486", You can't carry out this action at the
present time>. Afterwards, I have a hard time even
closing down the application, and cannot close Access at
all. I have to end the Access using the task manager.
When I press debug I see that the error is
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
When I reopen the database and I go to the same ordes I don’t have a problem to add as many product I want

What could be the reason?
Please, Help! Thanks,
 
i replace the
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

with
DoCmd.RunCommand acCmdSaveRecord

and its ok now
it is correct like this?
 
This problem may happen when there's either some code running or a Query is open in design view. Also Timer events can upset things. Suggest that you go to a module and choose Debug > compile to help find any code errors. Make a backup before anything. In the database window choose Tools > Database utilities>Compact & Repair.

Disable the Command buttons one by one to see if you can find which is behaving badly. (Set its Enabled properyt to false)
 
i found in msdn that

Note In Microsoft Access 97, the DoMenuItem method has been replaced by the RunCommand method. The DoMenuItem method is included in this version of Microsoft Access only for compatibility with previous versions. When you run existing Visual Basic code containing a DoMenuItem method, Microsoft Access will display the appropriate menu or toolbar command for Microsoft Access 97. However, unlike the DoMenuItem action in a macro, a DoMenuItem method in Visual Basic code isn't converted to a RunCommand method when you convert a database created in a previous version of Microsoft Access.

Some commands from previous versions of Microsoft Access aren't available in Microsoft Access 97, and DoMenuItem methods that run these commands will cause an error when they're executed in Visual Basic. You must edit your Visual Basic code to replace or delete occurrences of such DoMenuItem methods.


My db is converted from access95
and i want to know if the
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

is the same with
DoCmd.RunCommand acCmdSaveRecord

thank you verry much
 

Users who are viewing this thread

Back
Top Bottom