Error 2046 when using OutputTo

R

RichardGarfield

This is a re-post from Forms Coding in case I was in the wring place:

I am using 'OutputTo' to generate a report in snapshot format.

It works perfectly when I bypass the StartUp form with the shift key, so
that it goes into edit mode. But when I start the database as a user would
do, and get to the snapshot generation code, I get the error message "2046:
The command or action 'OutputTo isn't available".

Would appreciate some expert advice.

Richard
 
R

Robert Morley

RichardGarfield said:
This is a re-post from Forms Coding in case I was in the wring place:

I am using 'OutputTo' to generate a report in snapshot format.

It works perfectly when I bypass the StartUp form with the shift key, so
that it goes into edit mode. But when I start the database as a user would
do, and get to the snapshot generation code, I get the error message "2046:
The command or action 'OutputTo isn't available".

Would appreciate some expert advice.

Richard

Are you jumping straight into the snapshot generation code in the Open or
Load event of your startup form? If so, try moving that code into the Timer
event if you can, with an interval of 1, then just set the interval back to
0 as the very first thing in the Timer event.

That may or may not be the problem, but I've seen wonky behaviour like this
sometimes in Access when it doesn't have a chance to "settle down" after
startup, so it's worth a try.



Rob
 
R

RichardGarfield

Thank for the suggestion, Rob.

The snapshot generation only occurs when a command button is activated on
the main form. It occurs in Stephen Lebans's code for converting a snapshot
file to PDF and is in its own module.

When the user starts the program, the main form appears immediately;
otherwise there is no difference from when I am in edit mode.
 
P

pietlinden

Thank for the suggestion, Rob.

The snapshot generation only occurs when a command button is activated on
the main form. It occurs in Stephen Lebans's code for converting a snapshot
file to PDF and is in its own module.

When the user starts the program, the main form appears immediately;
otherwise there is no difference from when I am in edit mode.

Try putting a DoEvents in the line before the code that fails. Maybe
Access is still doing something under the covers. at any rate, if it
doesn't work it's a simple change....
 
R

RichardGarfield

Many thanks for suggestion - tried it but still no joy! Tearing my hair,
because it works perfectly in test.
 
M

muneca

Any luck yet? I'm having exactly the same problem. It seems to be something
to do with the database window.
 

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