For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > October 2004 > Need help printing Access report from VB6









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Need help printing Access report from VB6
Angel b1

2004-10-27, 3:55 pm

Hello,

I have a Vb 6 application that prompts the user for the criteria used in a
access97 report and then prints the Access report.
I would like to see just the ONE prompt, VB OR the Access criteria prompt.
Im currently getting two prompts.
The parameter passed to Access is the same as the Access query criteria.


Here is my code

result = InputBox("Enter Starting Range, MMYYYY", vbOKCancel, "Print
Invoices")

Set appAccess = New Access.Application
appAccess.OpenCurrentDatabase
" c:\vb_projects\PriorAuthInvoice\PriorAut
hInvoice.MDB"
Set qrySelectCurrentInvoices =
appAccess.CurrentDb.QueryDefs("qrySelectInvoices")
qrySelectCurrentInvoices.Parameters("Enter Invoice Date:") = result
appAccess.DoCmd.OpenReport "TBLINVOICE", acViewPreview

Screen.MousePointer = vbHourglass
appAccess.DoCmd.PrintOut acPrintAll
appAccess.CloseCurrentDatabase
appAccess.Quit
Set appAccess = Nothing



Expand AllCollapse All

Veign

2004-10-27, 8:55 pm

Same question asked on the 25th, 26th, and now the 27th. Did you even read
the response on the 26th?

--
Chris Hanscom - Microsoft MVP (VB)
http://www.veign.com
--

"Angel b1" <Angelb1@discussions.microsoft.com> wrote in message
news:678CD87C-424A-4DE3-A400-B66391664E79@microsoft.com...
> Hello,
>
> I have a Vb 6 application that prompts the user for the criteria used in

a
> access97 report and then prints the Access report.
> I would like to see just the ONE prompt, VB OR the Access criteria

prompt.
> Im currently getting two prompts.
> The parameter passed to Access is the same as the Access query criteria.
>
>
> Here is my code
>
> result = InputBox("Enter Starting Range, MMYYYY", vbOKCancel, "Print
> Invoices")
>
> Set appAccess = New Access.Application
> appAccess.OpenCurrentDatabase
> " c:\vb_projects\PriorAuthInvoice\PriorAut
hInvoice.MDB"
> Set qrySelectCurrentInvoices =
> appAccess.CurrentDb.QueryDefs("qrySelectInvoices")
> qrySelectCurrentInvoices.Parameters("Enter Invoice Date:") = result
> appAccess.DoCmd.OpenReport "TBLINVOICE", acViewPreview
>
> Screen.MousePointer = vbHourglass
> appAccess.DoCmd.PrintOut acPrintAll
> appAccess.CloseCurrentDatabase
> appAccess.Quit
> Set appAccess = Nothing
>
>
>
> Expand AllCollapse All
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com