473,699 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MS Access Calendar Error when Printing

RockKandee
89 New Member
Hi,

I am getting an error message when trying to print.

I am using the MS access calendar found here:

http://bytes.com/topic/access/answer...ccess-calendar

I have Windows 8 and Office/Access 2013. I am using this in a desk top database and would like to transfer it to a web database in the future.

I want to print this calendar. I haven't found a way to make a report so I tried to print the form. I get an error message when I select print and the same error message each time I open a table (or anything else) from then on. Once I close and reopen the database, all is good again until I try to print.

Error message:
Error inPopulateCalen dar()
Invalid use of Null

Is there a solution for this?

Thanks for your time.
Dec 8 '13 #1
10 1688
ADezii
8,834 Recognized Expert Expert
Have you tried:
Expand|Select|Wrap|Line Numbers
  1. Application.Printers("Printer Name").Orientation = acPRORLandscape
  2.   DoCmd.PrintOut
  3. Application.Printers("Printer Name").Orientation = acPRORPortrait
Dec 8 '13 #2
RockKandee
89 New Member
I am very, VERY new at this. No I hadn't tried but I have now - I think.

I am not sure what I was supposed to do with this code. I assumed I should pick either the landscape or portrait, not use both, though I did try with both. I used the printer name exactly how it is displayed on the printer drop down where I choose which printer to print with. I made a command button on the calendar form and entered the below code in the on click.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.PrintOut "Application.Printers("HP Deskjet 3050A J611 series (Copy 1)").Orientation = acPRORLandscape"
I followed examples of other code to the best of my understanding. I received the following error

Compile Error: Syntax error

Not sure if the code has errors because of the spaces in the printer name and if so, I don't know what to do.

Thanks
Dec 9 '13 #3
PPelle
17 New Member
Remove the first and the last ", like this:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.PrintOut Application.Printers("HP Deskjet 3050A J611 series (Copy 1)").Orientation = acPRORLandscape
Dec 9 '13 #4
RockKandee
89 New Member
I removed the first and last " like this

Expand|Select|Wrap|Line Numbers
  1. DoCmd.PrintOut Application.Printers("HP Deskjet 3050A J611 series (Copy 1)").Orientation = acPRORLandscape
I no longer receive an error message - Thank you.

It is going directly to print and printing 4 pages. I do not want 4 pages printed. I only want to print the current page. The print message that pops up after I click the print button flashes too fast for reading. Maybe I need to go to print preview instead of directly to print.


I found this in another post and tried it.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunCommand acCmdPrintPreview
This results in giving me the original error message...

Error message:
Error inPopulateCalen dar()
Invalid use of Null
Dec 9 '13 #5
PPelle
17 New Member
The error is caused by the Form_Activate procedure. But printing the form is to no use anyway, since it is unbound, all fields will be empty in the printout. You will need to design a report based on the table which holds the data you want.

Maybe it would be easier for you to try another calendar, like this one, which has a nice report included.
Dec 9 '13 #6
RockKandee
89 New Member
Thanks for the link. That looks like a great calendar for anyone looking to replace their Outlook Calendar. I am sure I will find a use for it in the future.

Now back to the original calendar....If I print the calendar form, it DOES display the data. The error message is occurring with print preview only. No one else should need to preview, so I can live with the error.

I would like to avoid printing 4 pages though. Is their code to add to the print command so that only page 1 will print?

Thanks
Dec 10 '13 #7
ADezii
8,834 Recognized Expert Expert
I use a primitive, but very effective means to Print the Access Calendar as long as there is no data that extends vertically beyond the Date Blocks.
  1. Make sure that the Calendar Form is the Active Window and is centered.
  2. Perform a Screen Capture of the Active Window (Calendar) via ALT+PRTSCRN.
  3. Open Microsoft Word, set the Margins to .5 all around and Landscape Orientation.
  4. Center the Cursor.
  5. Paste the Image of the Active Window (Calendar) from the Clipboard (CTRL+V).
  6. Of course I could use Automation Code to perform the above but it seems hardly worth it since the operation only takes a few seconds and the results are great.
Dec 10 '13 #8
PPelle
17 New Member
If I print the calendar form, it DOES display the data.
That's right, if you do a direct print. Printpreview will interfere with the data population, and give you the error you see and no data in the report.

This will open the print dialog (Access 2003, hopefully in 2013 also), where you can adjust margins so the form will fit on one page:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunCommand acCmdPrint
Dec 10 '13 #9
RockKandee
89 New Member
I would rather not have users go through a process to print a page just to avoid 3 pieces of paper running through the printer.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunCommand acCmdPrint
This command will not allow for margin adjustment in Access 2013. It will allow print range though, but the user would need to know to only print page 1.

I can't avoid the error message when setting margins, but they are already set and should remain fine unless I re-size the calendar again. The user will not need to use print preview so I will look into a way to disable the feature to avoid error messages.

I will continue looking around for printing code so only page 1 will print. Maybe this info is out there somewhere.

For now I will just deal with the extra 3 pages when printing.

Thank you all for the help and for your time.
Dec 10 '13 #10

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

Similar topics

0
274
by: Gary | last post by:
Hi, I am getting this error within vb.net when i try and print to a printer... "Value cannot be null." the line "e.Graphics.DrawImage9me.PictireBox1.Image,0,0)" is highlighted. My code below...
7
12149
by: Charts | last post by:
I login as administrator of the machine. However running the following code get access denied exception for file inside the directory. The source code: DirectoryInfo target = new DirectoryInfo(TargetDirectory); target.Delete(true); I don’t have problem manually delete the whole directory. Please advice. Thanks,
1
1547
by: Saifee | last post by:
hi, I am using Microsft Outlook library in aspx.vb page, but when i run the function i get error of access denied and some user accounts. Please help!!!!!!!!! rgds, Saifee.
5
7403
by: ElGordo | last post by:
In our dev environment, our ASP.Net application works fine and outside users can access it when provided with the proper URL. Once we moved the application to our public server, we now get a 401.2 error. A windows login prompt occurs once the URL is accessed in the browser and nobody can log in (no login appears on our dev server). None of the files have changed, and the Virtual Directory is configured identically to that of our dev...
0
1230
by: Peter Qian | last post by:
Hi All, I have a simple design where a IPC Client channel sits inside an asp.net application and talks to a backend custom data provider. It all works great when I run it under VS 2005's debugging server (the one that comes with VS), however when I deploy the application using Publish to IIS and run it there, i got the following error: Failed To Connect to an IPC Port: Access is denied. System.Runtime.Remoting.RemotingException: Failed...
1
1562
by: neelima | last post by:
Hi All, I am trying to build a webservice which would create a powerpoint presentation and save it to the file system. I am using the Powerpoint COM object for this purpose. The standalone windows application runs fine, but when I create a webservice on the same line i get a "Access denied error". This error occurs when the application is trying to create a Powerpoint.ApplicationClass. Does anyone have any ideas?
1
2632
by: Scott Yen | last post by:
Hi, I'm using the following Axis java client to invoke a .Net web service hosted my localhost. Although the username and password is set on the "call", client gets (401) Access Denied" exception. private static void testTest() { try { String endpoint = "http://localhost/WebService1/Service1.asmx"; String method = "Test";
5
1647
9815402440
by: 9815402440 | last post by:
hi i am using acess 2003 as back end of my application. database was fine a few days back. i have a table named Ac_LedgerMaster. i have several tables that are related to this table. now relations to a field in this table have reached the maximum limit i.e. i can no more relate this paricular field to any other table. but this database is still fine. after that i added 7 union queries. there are 3 other quereis that are drawing data from the...
7
1941
by: matt753 | last post by:
This problem only occurs when running from the MDE file, works perfectly fine when trying it from the original MDF. I have a command button that prints a report, except after pressing it, a error comes up: "The expression On Click you entered as the event property setting produced the following error:The OpenReport action was cancelled." Does anyone have any idea what this could be from?
1
2621
by: harinisuresh | last post by:
Download source code of Program : http://www66.zippyshare.com/v/96114261/file.html I got Error 'Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))' of using cross domain in webbroser iframe tag. Error Line : WebBrowser1.Document.Window.Frames(0).Document.GetElementsByTagName("input").Item(0).InnerText = "MyValue1" Please solve the program. Thanks.
0
8687
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
9174
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
8884
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7751
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
5875
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
4376
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
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
2009
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.