473,765 Members | 1,964 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
16 4508
NeoPa
32,572 Recognized Expert Moderator MVP
I guess you can see that this is the answer to your question though yes? The subsequent code is never executed as the line causes an error, from which your error handling code simply returns execution to the end of the subroutine.

Some further information could be displayed from the contents of the Err object in your Error Handling routine should you wish.
Dec 24 '09 #11
g diddy
54 New Member
thanks for all your help and advice guys. i'm off work til the 4th of jan but when I get back i'm going to try a few things and see how it goes; using everything you've said to guide me. I'll let you know how it goes. thanks for your help
Dec 25 '09 #12
missinglinq
3,532 Recognized Expert Specialist
As NeoPa has pointed out, your code is causing an error, which drops you to the error handler, thus bypassing the message box. The problem is here:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OutputTo acReport, MyChoiceOne, "SnapshotFormat(*.snp)", "c:\" & MyReportOne & ".snp", False, ""
Instead of acReport it should be acOutputReport, which should be popping up as a choice from Intellisense.

Linq ;0)>
Dec 26 '09 #13
g diddy
54 New Member
Thanks very much for that correction missinglinq, the error message now no longer appears. For some reason though, when I step through the code it still gets to this line and then shows the message box saying that it is outputting to file but then the code stops and when I step through again it starts at the beginning of the code. There are no error messages and everything after this line is ignored, even msgbox, and also the file is not created. I'm going to try a few things over the next few days but if anyone has any ideas that would be great. Thanks for all your time!

Edit: I changed the location from C to U (my personal drive at work) and the file outputted so the output problem may be something to do with access privelages. I've managed to get it working correctly now. Thanks very much for all your time and effort.
Jan 4 '10 #14
NeoPa
32,572 Recognized Expert Moderator MVP
That's good to hear, but it's always better to understand what's going on - especially when things don't work as required.

I sometimes find that the Error Trapping setting in the VBE can cause issues for people trying to debug. Debugging in VBA is a useful resource when thinking about debugging, but more specifically, Debugging in VBA - 3) General Tips discusses the settings that should be selected for most effective debugging.
Jan 4 '10 #15
g diddy
54 New Member
Thanks NeoPa they are very useful!
Jan 4 '10 #16
NeoPa
32,572 Recognized Expert Moderator MVP
Always a pleasure G_Diddy :)
Jan 4 '10 #17

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

Similar topics

18
7541
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
2201
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
26481
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
5399
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
10418
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
5531
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
3393
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
9568
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
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10007
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...
1
9955
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8831
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
6649
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
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
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
3
2806
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.