|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
"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. |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > "OutputTo" isn't avaliable now |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|