Run-time error '2766'

I'm getting the following error when I try to run a macro after a combo box updates:

Run-time error '2766':
The object doesn't contain the Automation object '|.'

"cboUpdCust" is a 2 column count combo box.  The condition in the macro is:

I wrote a query using the value from the combo box as a criteria and it worked fine...Example "ID" = 2.  Debug.Print in the Immediate Window also shows that the value is 2.  What gives?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Convert the macro to Visual basic. Post the code of the macro and post which line causes the error.
error_proneAuthor Commented:
I shouldn't have to convert the macro to VB.  Here's what the after update of the combo box does:

Private Sub cboUpdCust_AfterUpdate()
    Me.txtCustDisplay = Me.cboUpdCust & " " & Me.cboUpdCust.Column(1) & " " & Me.cboUpdCust.Column(2)
    DoCmd.RunMacro ("mcr_Upd_Customer")

End Sub

Macro "mcr_Upd_Customer" runs simple action queries with this in the condition section:
So which line in the macro is causing the error?
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

error_proneAuthor Commented:
The condition in the macro is causing the error.  I took it out and it worked fine.  Is this not the right syntax?  

One of the macro actions this condition is on is a delete query.  So I only want the macro to delete records from tbl_Customer where the ID is equal to the value in cboUpdCust.  I know I can put it in the where clause of the sql statement, but I have multiple queries and I want to re-use objects - that's why I need to use the conditions in a macro.  
The condition column decides whether you run a command or you don't. It will not select records from a table for deletion. Furthermore, when evaluating the condition, there is nothing called "tbl_Customer" accessible. This would be valid only from within a query having "tbl_Customer" in its FROM clause.

You will have to write a query with the condition included, which you can then run directly using DoCmd.RunSQL instead of RunMacro.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
What action is the condition statement in? What are all the arguments of the action?
Even simpler: delete the customer selected in the combo box...

CurrentDb.Execute "DELETE FROM tbl_Customer WHERE ID=" & cboUpdCust

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.