The format in which you are attempting ...

TheSearcher

Registered User.
Local time
Today, 06:20
Joined
Jul 21, 2011
Messages
385
I'm getting the error message "The format in which you are attempting to output the current object is not available" when running the following code from a module:

DoCmd.OutputTo acOutputReport, "r_Nafta", "acFormatPDF", "c:\ohus_access\Nafta.pdf"

I'm using Access 2010.
acFormatPDF does show up in my "List Properties/Methods.
I've done this successfully many times on this computer - even this code worked a few months ago.
What can possibly be happening????
Thanks,
TS
 
acFormatPDF is a constant. Try

DoCmd.OutputTo acOutputReport, "r_Nafta", acFormatPDF, "c:\ohus_access\Nafta.pdf"
 
Thanks pBaldy. I tried that along with many other suggestions I found on the Internet. None of them worked but I just discovered what the problem was!!
I'm using a table in the recordsource that has a field named "Nafta." This field was originally a text field in which I would place either the values "yes" or "no." The code worked perfectly then.
But then I changed the datatype of that field to yes/no. But my queries still had the yes and no in quotations ("yes", "no").
When I took the quotations out of the queries everything began to work again.
Why Microsoft would offer that error message is beyond me - but I'm happy that my issue is now resolved.
I see that many people have struggled with this. I hope they read this post!
 
Glad you got it sorted. Some MS error messages bear no resemblance to the actual problem. :confused:
 
It's a constant..why didn't I think of that? :p
 

Users who are viewing this thread

Back
Top Bottom