Printing Access reports which require parameter input
Printing Access reports which require parameter input
Printing Access reports which require parameter input
Printing Access reports which require parameter input
Printing Access reports which require parameter input
Printing Access reports which require parameter input Printing Access reports which require parameter input Printing Access reports which require parameter input Printing Access reports which require parameter input Printing Access reports which require parameter input Printing Access reports which require parameter input Printing Access reports which require parameter input Printing Access reports which require parameter input
Printing Access reports which require parameter input Printing Access reports which require parameter input
Printing Access reports which require parameter input
Go Back  Xtreme Visual Basic Talk > > > Printing Access reports which require parameter input


Reply
 
Thread Tools Display Modes
  #1  
Old 05-07-2008, 08:05 AM
ABOU ABOU is offline
Newcomer
 
Join Date: May 2008
Posts: 2
Default Printing Access reports which require parameter input


VB.net
VS2005 - .net 2.0
Office 2007 (needs to be compatible for 2003)
Using an '03 compatible save of database

Background

GymTech2000
I have created a program which is used to add/delete/edit clients and also assign them workout programmes. I am using 2 combo boxes to select the client record and the programme i wish to assign.

I have also added some code to get the report to print, which i placed in the print button code (is this an ok place to put it?).

Code:
Dim oAccess As New Access.Application


        'Start a new instance of Access for Automation:
        oAccess = New Access.ApplicationClass()

        'Open a database in exclusive mode:
        oAccess.OpenCurrentDatabase(filepath:="c:\GT2000.mdb", Exclusive:=True)

        ' Print a report named rptTest:
        oAccess.DoCmd.OpenReport(ReportName:="rptGetAll", _
           View:=Access.AcView.acViewNormal)

        '----------------------------------------------------------------------------

        ' Cleanup:
        GC.Collect()
        GC.WaitForPendingFinalizers()
        GC.Collect()
        GC.WaitForPendingFinalizers()

        'quit access
        oAccess.Quit(Access.AcQuitOption.acQuitSaveNone)
rptGetAll is Controled by two input parameters, PID (programme ID) and CID (Client ID)

They are requested in that order when the button is clicked.

If i wish to code so the parameters are pre-entered according to the selected value of the combo boxes so the user does not have to enter them but rather uses the selected value of the two combo boxes and clicks print, is this possible?


http://img254.imageshack.us/img254/8...cplrgewz3.jpg/

That is a pic of my form( the print button isnt on there though)
Reply With Quote
  #2  
Old 05-08-2008, 09:00 AM
Mike Rosenblum's Avatar
Mike Rosenblum Mike Rosenblum is offline
Microsoft Excel MVP

Forum Leader
* Guru *
 
Join Date: Jul 2003
Location: New York, NY, USA
Posts: 7,848
Default

Hi ABOU,

Welcome to the forum.

I have very little experience with Access, I'm afraid (or databases in general), so I don't know how much I can help.

Is your question "how do I get a value from a combobox" or is it "how to I create a query based on the value that I have gotten from the combobox"?

Mike
__________________
My Articles:
| Excel from .NET | Excel RibbonX using VBA | Excel from VB6 | CVErr in .NET | MVP |
Avatar by Lebb
Reply With Quote
  #3  
Old 05-10-2008, 02:27 PM
ABOU ABOU is offline
Newcomer
 
Join Date: May 2008
Posts: 2
Default

The report i have created is based upon a query and requires a parameter input in order to display the information on the report, what i wanted to do was pass the value in a combo box as the parameter, but as time is tight to finish off im gonna leave it out.
Reply With Quote
  #4  
Old 05-10-2008, 04:38 PM
Mike Rosenblum's Avatar
Mike Rosenblum Mike Rosenblum is offline
Microsoft Excel MVP

Forum Leader
* Guru *
 
Join Date: Jul 2003
Location: New York, NY, USA
Posts: 7,848
Default

Ok, I got you, time pressure is always the enemy...

If you look into it in the future, though, the ComboBox.Text property would give the value currently held by the ComboBox. You could then use that value as your input parameter.

Here are a couple of tutorials/examples:

(1) Get Text from ComboBox
(2) AutoComplete ComboBox in VB.NET

I hope this helps...
Mike
__________________
My Articles:
| Excel from .NET | Excel RibbonX using VBA | Excel from VB6 | CVErr in .NET | MVP |
Avatar by Lebb
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Printing Access reports which require parameter input
Printing Access reports which require parameter input
Printing Access reports which require parameter input Printing Access reports which require parameter input
Printing Access reports which require parameter input
Printing Access reports which require parameter input
Printing Access reports which require parameter input Printing Access reports which require parameter input Printing Access reports which require parameter input Printing Access reports which require parameter input Printing Access reports which require parameter input Printing Access reports which require parameter input Printing Access reports which require parameter input
Printing Access reports which require parameter input
Printing Access reports which require parameter input
 
Printing Access reports which require parameter input
Printing Access reports which require parameter input
 
-->