Execution of DoCmd from form

R

Ron

in regards to an earlier post, I have a simple if
statement that if the condition is true the DoCmd is
executed and if false a msgbox appears. This DoCmd simply
executes a RunMacro cmd. The macro name is defined in
quotes. With the form open the macro and related Query
works with no problems. When the call to do the DoCmd is
made from the form the error "The object doesn't contain
the Automation object 'Sales' " What the macro is suppose
to do is email a Microsoft Excel sheet to specific people
based on a query. This error only occurs the very first
time a person logs into the Main form and checks a box.
Unchecking and rechecking the box executes the command
just fine and from that point on not problems occur until
Access is closed and then reopened. then the error occurs
again but only once. With more specific information can
anyone help me figure this one out? I also put the macro
commands directly in the coding and the same error occurs
with nofurther explaination.
 

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