Runtime Error 2486

P

Pharoh

I'm trying to run an Access macro in VB6. When I launch the application
and click the button, the macro should run but instead I get this damn
2486 Error 'You can't carry out this action at the present time'

here's the code I'm using..

rivate Sub Command1_Click()
'Dim INDY92ACCESS As DAO.Database
Set INDY92ACCESS = OpenDatabase("C:\Database")

DoCmd.OpenQuery "Insert 5%", acNormal, acEdit
DoCmd.OpenQuery "Insert 7/5%", acNormal, acEdit
DoCmd.OpenQuery "Insert 10%", acNormal, acEdit


Add2Groups_Exit:
End Sub
 
G

Guest

Hi Pharoh,

not sure if this is just a misprint but your declaration for INDY92ACCESS
appears to be commented out. Is that correct?
 
G

Guest

Two more question, do you know which line of code fails?

Also, regarding the line
Add2Groups_Exit:
what is that for? Usually that'd be used for your error handler. I'm curious
if that line isn't required, take it out
 
P

Pharoh

I actually removed everything in the middle and just put in

DoCmd.RunMacro "Add2Groups"

End Sub

It fails on - DoCmd.RunMacro "Add2Groups" - but before it would fail on
the first line - DoCmd.OpenQuery "Insert 5%", acNormal, acEdit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top