Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 1st, 2003, 03:41 AM
Registered User
 
Join Date: Oct 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default On click open a report

hi all.
this might sound a bit basic, but so are my skills at the moment with access.
the thing im looking to be able to do is...

How do i make it so a report opens when i click a button in a form... is it possible? im sure there must be a way.
cheers all

ViTA

 
Old October 1st, 2003, 07:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 126
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Good morning.
Once you have created your button, create an "on click" procedure. (I don't recommend using the wizard for this...my opinion is that it is easier to create a button with out the wizard when you are going to create your own event for it.)
For the code, you'll use the following line of code:
Docmd.OpenReport "Report Name", view preferred, filter, condition, window mode, open arguments

The "Docmd.OpenReport" you will type in. The view, filter, condition, window mode, & opening arguments are all items that you chose depending on exactly how you want the report to open.
I hope this helps.

Regards,
Laura

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!
 
Old October 1st, 2003, 09:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Quote:
quote:Originally posted by lbreitenbach
(I don't recommend using the wizard for this...my opinion is that it is easier to create a button with out the wizard when you are going to create your own event for it.)
Really? I'm just the exact opposite. When I create a button with an event I let the Wizard do its thing and then I tweak the code it generates with what I want. It's great because it does 80% of the typing I would have done without syntax error or misspelling; and it takes care of "Now what exactly is the syntax for that command?" or "Now what command was that again?"

Vita, if you do elect to keep the Wizard on, you'll see the command Laura talked about and all you have to do is tweak it.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old October 1st, 2003, 07:52 PM
Registered User
 
Join Date: Oct 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

zzzzzoooommmmm
straight up and over my head.

i understade the whole = Docmd.OpenReport "report name" bit and where to put it (the onclick field) but what i dont get if the filter, condition, window mode..... and is the expression builder the wizard that you are tlaking about??

sorry for my ignorance but i am trying to learn this, and not haveing a teacher or a book that goes past the basics is a bit hard :>

thanks all
VitA

 
Old October 2nd, 2003, 06:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Quote:
quote:Originally posted by vita
 zzzzzoooommmmm
straight up and over my head.
Don't panic!

In design view on your form, use the toolbox create a new button, choose to create an open report button, let the Wizard create the button then edit the code it creates. You'll see a line that starts with "DoCmd.OpenReport". Place your cursor on the word "OpenReport" and press the F1 key. You'll get help on everything Laura talked about.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Right click to Open a menu peace2007 Ajax 2 November 5th, 2007 02:25 AM
how to open new window on button click nittin14 ASP.NET 1.0 and 1.1 Basics 8 April 28th, 2007 12:13 AM
double click to open link thutt Dreamweaver (all versions) 0 February 8th, 2007 05:01 PM
Open a new window on a button click ag19702004 .NET Framework 2.0 1 January 6th, 2007 12:21 AM
Click even code for open DOS .EXE mohiddin52 Access VBA 4 October 18th, 2006 12:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.