473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do I have a report ask for parameters just one time?

18
I have 2 queries each with parameters to select month and year [Enter Month #] and [Enter Year]. Both do exactly as I want. When I run a reports based on the 2 queries they work great. How do I run both queries in one report and have it ask for the parameters just once? One report is run as a subreport.
Aug 6 '09 #1

✓ answered by ajalwaysus

I would suggest you put a form in front of the report with the date fields as text boxes, that way you can tie the queries to the text boxes and they will inherit the dates on load.
i.e.
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM TABLE1 WHERE StartDate = Forms!MyForm!txtStartDate.Value
I don't think there is another way because your quires are independent, and therefore need independent data entry.

6 1657
ajalwaysus
266 Expert 100+
I would suggest you put a form in front of the report with the date fields as text boxes, that way you can tie the queries to the text boxes and they will inherit the dates on load.
i.e.
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM TABLE1 WHERE StartDate = Forms!MyForm!txtStartDate.Value
I don't think there is another way because your quires are independent, and therefore need independent data entry.
Aug 6 '09 #2
pld60
18
Ok, I created a form that asks for month # and year with a comand button that opens the report and enters the entered month and year for the queries. Everything works great except the report automatically prints and never opens. It prints the correct information. How do I fix it so it just opens the report to review and then can be printed by clicking on print?
Aug 6 '09 #3
pld60
18
I should have added the code for the comand button

Private Sub Command14_Click()
Me.Visible = False
DoCmd.OpenReport "Incident Report by Month", acViewNormal, acEdit
DoCmd.Close acForm, "Report by Month"

End Sub
Aug 6 '09 #4
ChipR
1,287 Expert 1GB
Try
DoCmd.OpenReport "Incident Report by Month", acViewReport
Aug 6 '09 #5
pld60
18
Thanks for the responses. ChipR I tried this code and it does the same thing.
Aug 7 '09 #6
pld60
18
acViewPreview is what I needed, thanks for the help
Aug 10 '09 #7

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

Similar topics

1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
8
by: Mark Flippin | last post by:
This is for a reporting problem using: Access 2000 SQL Server 2000 Both at SP3 I've a stored procedure in SQL Server 2000 which builds a result set from a disparate set of tables, utilizing...
1
by: Fred Zuckerman | last post by:
I have 8 reports that I want to run. Each report is only about 6-7 lines long. I'd like to get them all on a single page. So I created a parent report and made each of the 8 desired reports a...
15
by: Richard Hollenbeck | last post by:
I tried to ask this question before on the 14th of January but I never got a reply. I'm still struggling with the problem. I'll try to rephrase the question: I have a crosstab query with rows...
2
by: Denise | last post by:
How do I get the report to not spend time pulling up the data when I'm going to bail out of the report anyway? Below is the code in my report. I first show the user a form where they can select...
12
by: Bill Nguyen | last post by:
What's the VB syntax to run the CR report using the following SP? I use CrystalreportViewer and ReportDocument. Thanks Bill Here's the SP in SQLserver 2K: CREATE proc mysp_ReportSubmission...
0
by: Chris | last post by:
I have the following situation in a VB.Net App I am working on: 1.)A report created in VS.Net 2003 using the CR.Net component of VS 2003. 2.)The datasource for the report is a Stored Proc in a...
0
by: kamboj.shalabh | last post by:
Hi to all, Well, I am working on dotnet 2005 with crystal reports 10 and backend as sql server. I am facing a problem while loading a report. Actually the issue is, when I load report it takes...
3
by: Richard Hollenbeck | last post by:
I am very sorry about the (almost) re-post, but you will see that my first question wasn't very clear; I have another question I posted this morning called, "in DAO: Run time error 3061 Too few...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...

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.