Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 31st, 2005, 01:31 PM
ccool ccool is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 3 ccool User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 24 sec
Reputation Power: 0
"OutputTo" isn't avaliable now

Hi,

On the close trigger for my form I'm tring to output two reports:

Filename = FileName_Functions.FormatFileName("OldBooks")
DoCmd.OutputTo acOutputReport, "rOldBooks", acFormatSNP, Filename, False

Filename = FileName_Functions.FormatFileName("BarcodesScanned")
DoCmd.OutputTo acOutputReport, "rBarCodeList_2Col", acFormatSNP, Filename, False

What is happening is the first report is outputting but the second one is not. When I run the debugger when the program tries to run the second OutputTo I am getting the following error message:
Runtime error '2046'

The command or action 'OutputTo' isn't avaliable now

Any idea to why I may be getting this message or what it may mean.

Reply With Quote
  #2  
Old January 31st, 2005, 05:07 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Look at your Filename Function for the problem. The code appears to be running the function only one time on close. It works fine otherwise when specifying the exact File path and extention.

Just an idea,

lwells

Reply With Quote
  #3  
Old February 1st, 2005, 11:58 AM
ccool ccool is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 3 ccool User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 24 sec
Reputation Power: 0
The function is returning a path with a filename. Prior to both instances of the OutputTo call the functions are executing and returning the correct value.

To confirm this I hardcoded the path and file name and ended up with the same result.

The first OutputTo call executes but the second one does not. When I try to trace the execution using the debugger when it gets to the second OutputTo I get: Runtime error '2046' The command or action 'outputTo' isn't available now

I also changed the order of the OutputTo commands executing the second one first and still had the same result.

Has anyone else ever seen this behavoir?

tia

Chad Z

Reply With Quote
  #4  
Old March 1st, 2005, 08:34 AM
Christyxo Christyxo is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 1 Christyxo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 18 sec
Reputation Power: 0
Hey Guys,

I'm just curious to whether or not you have resolved this problem. I am experiening an identical problem trying to run two output to codes.

Same error as well.

The only difference to yours is that if I run the access database normal with the Show Database window checked then i doesn't work, whilst if I allow the database window to be shown it works.

Reply With Quote
  #5  
Old May 20th, 2005, 11:11 AM
b_engelhart b_engelhart is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 1 b_engelhart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 8 sec
Reputation Power: 0
I came up with a fix to this problem. Just turn the echo off right before your code runs then programatically show the databasewindow. after your code runs hide the database window and turn the echo back on:

docmd.echo false
'Show the db window
docmd..SelectObject acTable, , True

'Run code here - all your output to's will work here

'Hide the DB window again
Docmd.SelectObject acTable, , True
Docmd.RunCommand acCmdWindowHide

'turn the echo back on
docmd.echo true

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > "OutputTo" isn't avaliable now


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT