473,748 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

code after "Docmd.OutputTo .." ignored?

54 New Member
Hi, I have used the Docmd.outputto function in various places in my code but for some reason all code that comes afterwards, even msgbox doesn't show. I was just wondering if there is anything that could be causing this. For example in the snippet below the docmd command brings up a box saying that it is outputting the file to c:\FullTimetabl e.snp but no msgbox appears saying "test". I have about 6 or so if statements with the same problem and i'm hoping it is nothing major. Your help is greatly appreciated!

Expand|Select|Wrap|Line Numbers
  1. If [Forms]![ReportsMenu]![InvigTTBySchool].Value = True Then
  2. ChoiceOne = True
  3. MyChoiceOne = "FullTimetablebyFaculty"
  4. MyReportOne = "FullTimetable"
  5.     DoCmd.OutputTo acReport, MyChoiceOne, "SnapshotFormat(*.snp)", "c:\" & MyReportOne & ".snp", False, ""
  6. MsgBox "test"
  7. Else
Thanks!

Allen
Dec 23 '09 #1
16 4504
ChipR
1,287 Recognized Expert Top Contributor
Do any of your functions have error handling code?
Dec 23 '09 #2
g diddy
54 New Member
at the top of the function I have:

Expand|Select|Wrap|Line Numbers
  1. Function ExSnap1()
  2. On Error GoTo Macro1_Err
  3.  
and at the bottom I have:

Expand|Select|Wrap|Line Numbers
  1. Macro1_Err:
  2.     MsgBox Error$
  3.     Resume Macro1_Exit
  4. End Function
  5.  
apart from that there is no other error handling. PS Thanks for your quick response!!
Dec 23 '09 #3
ChipR
1,287 Recognized Expert Top Contributor
Very strange. Is the output file actually created? Does this happen with multiple reports? And, what happens if you stop on the DoCmd.OutputTo in debug and step forward?
Dec 23 '09 #4
Megalog
378 Recognized Expert Contributor
I've had this happen before. I think the problem was the report I was trying to output didnt have any records, so it would just drop the whole subroutine right at the DoCmd.OutputTo line.

Edit: Nevermind, I just tried recreating that scenario and the report outputs either way. If I remember exactly what the answer was I'll drop an update.
Dec 23 '09 #5
g diddy
54 New Member
that's another thing ChipR; it says the file has been created but it does not show up in the C drive. Also sometimes I get an error message saying that there is not enough free disk space to save it. I think this may be related in some way! However I cannot see why it isn't working - it used to work and the code for outputting it to a file is exactly the same. I'd hate to do it as the code is very long, but would pasting the entire code here be able to give you more context? I thought about that Megalog and i've just opened one of the reports and the information was there. However I do agree, I think that it may be just dropping the whole subroutine as after that line as even Msgbox "Test" doesn't work!!
Dec 23 '09 #6
g diddy
54 New Member
just done the step into and it went straight from the DoCmd Output To... to the error handler. No explanation why though!!
Dec 23 '09 #7
Megalog
378 Recognized Expert Contributor
I've seen the out of memory error happen when you try to feed an illegal filename/filepath into the command line. Although the filename you're using is about as simple as it can get. Are you on a work machine where perhaps your local policy is preventing files from writing to the root of your C: drive? Try hardcoding the output filepath/filename to your desktop location.
Dec 23 '09 #8
Megalog
378 Recognized Expert Contributor
This can also happen if the file you're trying to write to is already open by another process, or has been marked as read-only.
Dec 23 '09 #9
g diddy
54 New Member
yes it is a work machine, im not sure what the local policy with it is though so that may be the case, however i'm sure it used to work. How would I go about hard coding it to the desktop location? like say my personal drive was Y would I just simply need to change the C:\ to Y:\? As far as I know it isn't opened by another process. Later on in the code I convert from snp to pdf but as it doesn't seem to be outputting at all it isn't even getting anywhere near that stage so I don't reckon that is the problem... touch wood!
Dec 24 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

18
7537
by: Phill Long | last post by:
this is the the code, now here is the final result.... I get one combo box and one tex box come up, but they are empty... DAMN!!! Any ideas on what Im doing wrong please.. Thanks Again <?php require_once('..\library_database\Connections\onlinequote.php'); ?> <?
3
2200
by: Graham | last post by:
On page 89 of Stroustrup's book "The C++ Programming Language" 3rd Ed. He says that multidimensional arrays are best avoided outside low-level code. What precisely does he mean by low-level code? That is fairly relative terminology. Is he saying that the use of multidimensional arrays in C++ are not desirable? That doesn't seem right to me.
5
5677
by: apple | last post by:
UDBV8 fp 6a - AIX 5.1 We have scheduled cron jobs to do backups. Periodically and starting to occur more frequently, a backup fails with this error: SQL2072N Unable to bind the shared library "". Reason code: "". We are backing up to a file system on the server. Can't find anything in the logs. We can manually resubmit the job 15 or 30 minutes later and everything works fine. Any ideas on what might be happening? The documentation on...
6
26476
by: Wito | last post by:
hi, I want to backup database (db2, aix 5.1) using script. When I exec script logging to user db2inst1 then is everything ok, but from cron, I get these error: SQL10007N Message "-1390" could not be retrieved. Reason code: "6". Where is the problem?
2
5397
by: Tyson | last post by:
I have got this little piece of code that fires on exit of a text box. It run's my query perfectly based of my form input. But I don't know how to bring result in my query back to a text box on my form, and shut down query so I can keep using my form again. Thoughts? I am getting a little freaked, I am sure this must be easy? form is; frm_RR_datacapture query is;qprGB_Piece_SizefromTextBox textbox...
1
10416
by: Mitan | last post by:
Hello, I'm a beginner with what appears to be a simple question for which I haven't been able to get an answer. Can someone explain what "implementation code" is in relation to VB.NET? I want to be sure I have a good understanding of this before I continue with my studies. Thanks in advance. Semper Fi
2
5530
by: mike_li | last post by:
On Window 2000 Professional Server DB2 UDB Level: DB2 code release "SQL07029" with level identifie "030A0105" and informational tokens "DB2 v7.1.0.98", "n040510" and "WR21337". In the db2diag.log, ---------------------------------------------------- 2005-12-20-10.05.43.278000 Instance:MC Node:000
3
12015
by: nan | last post by:
Hi All, I am trying to connect the Database which is installed in AS400 using DB2 Client Version 8 in Windows box. First i created the Catalog, then when i selected the connection type as ODBC, then i am getting
2
3391
by: Coolboy55 | last post by:
Hi, I'm using the Form_Dirty event to run DoCmd.RunCommand acCmdSaveRecord, but it does not appear to be working, although the event does trigger. I want the record on the main form to be saved as soon as it becomes dirty, but even after the Dirty event runs, the record does not show up on the table. Am I missing something? Note: I have a subform as well, in case this has anything to do with it. Thanks! CB55
0
8995
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9558
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9378
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8250
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6077
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2216
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.