MS Access

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsDatabasesMS Access

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old March 26th, 2015, 10:23 AM
Gem1204 Gem1204 is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Jul 2013
Posts: 2 Gem1204 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 52 sec
Reputation Power: 0
Open report based on paramaterized query with vba

I need to open a report that is based on a parameterized query. The report can be opened from a variety of forms that users have to access to open the report. I know how to use the do command to open the report and pass a filter argument but that doesnít work if the report is based on parameters. I donít want to change the source of the parameters to a control on the form because this report can be accessed from several different forms and the query itself is used in several different reports showing different amounts of detail.

Iíve always been taught that itís better to open a report with the data you want to see rather than opening a report and then applying a filter after it is opened. Even if I wanted to, Iím not allowed to change the report or the query so Iím stuck with the parameterized query and making it work. The query is fairly complex with several tables one of which has over 200,000 rows.
he source of the parameters to a control on the form because this report can be accessed from several different forms and the query itself is used in several different reports showing different amounts of detail.

I can use this code to open a form based on the parameterized query but when I tried to use it on a report I got a message ďThis feature is only available in and ADPĒ and my tables are based on ODBC tables from a pervasive database and not an sql server ADP.
uery and making it work. The query is fairly complex with several tables one of which has over 200,000 rows.
he source of the parameters to a control on the form because this report can be accessed from several different forms and the query itself is used in several different reports showing different amounts of detail.

This is my code I can use to open a form
Code:
Private Sub Form_Open(Cancel As Integer)
    'This doesn't work on a report
    Dim mydb As dao.Database
    Dim Myqdf As dao.QueryDef
    Set mydb = CodeDb
    Set Myqdf = mydb.QueryDefs("qryPODetails")
    Myqdf.Parameters("WhatPO").Value = "0008009"
    Set Me.Recordset = Myqdf.OpenRecordset
End Sub


Is there any way to open this report as it is without removing the parameters and using a filter argument instead?

I'm using MS Access 2010

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesMS Access > Open report based on paramaterized query with vba


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap