473,505 Members | 15,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select a Specific Report to print based on date range

22 New Member
I find myself here again...I am using access 2007 and I have three Reports. What I am thinking I would like to do is have a single list box.combo box? whereby I can select a report and then be able to and or select a date range for that report and then be able to print. I hope this makes sense...

so

select a specific report

Product
Outgoing
Suppliers

enter choose date if applicable

Print that report.


Can this all be done with one or two clicks of the button as I am thinking that this would be simply placed on my main index? your help in the right direction would be appreciated
Jun 18 '10 #1
4 5926
Jerry Maiapu
259 Contributor
@heart01
That is possible.
What you need to do is basically, create a combo box on a unbound form and in the combo box's row source put "Product", "Outgoing", "Suppliers"

Now create two unbound txt boxes for the two date range.
To limit the results on the report (based on the date diff entered on the form) you have to put some criteria on the query where the 3 report are based on.

On the criteria section under your date column in the query you should use this syntax:

Expand|Select|Wrap|Line Numbers
  1. Between Forms![your form name]![name of first text box for date1] And Forms![your form name]![name of second text box for date2] 
Now add a command button on the form and on click event do some validation and use
Expand|Select|Wrap|Line Numbers
  1. DOCmd.OpenReport
to open the report based on condition.
You'll use
Expand|Select|Wrap|Line Numbers
  1. If <condition> Else 
vb conditional statements to make sure correct report is opened.

That is all I think you need to do..

Hope this helps..
Jun 18 '10 #2
NeoPa
32,557 Recognized Expert Moderator MVP
That's mainly good advice. I would only say that filtering is even easier than indicated.

No need to make the query link into the form (which can cause problems if/when it's not open). Instead you can build up the filter string in SQL form before passing this string as the WhereCondition parameter of the DoCmd.OpenReport() call.

Similar filtering is covered in Example Filtering on a Form.
Jun 18 '10 #3
heart01
22 New Member
I appreciate your response - I have the date selection happening but have no idea about linking the selection in the combo box to run and execute the report...I get as far as having the selecton choice available but that is ias far as it goes...
Jun 19 '10 #4
NeoPa
32,557 Recognized Expert Moderator MVP
OK. That's fine.

It sounds like you haven't read the linked article yet though. I suggest you go there first then, when you have the concept of building the filter string we can tell you how to apply it to opening a report.

If you get stuck with the string building from the article then come back and explain where you have a difficulty and we can surely clarify.
Jun 19 '10 #5

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

Similar topics

3
7446
by: manning_news | last post by:
Using A2K. I've been asked to modify a report currently requiring only one date parameter to now accept a date range. The main report has 2 subreports and is not bound to a table or query. The...
2
3832
by: Sara | last post by:
I have followed instructions on the http://allenbrowne.com/tips.html for limiting a report to a date range. At the bottom there is a note that says You will end up using this form for all sorts...
0
1438
by: rdemyan via AccessMonster.com | last post by:
I have a need to highlight a date range in a bar chart. If the "highlighting" is accomplished by changing the bar column color for the specific months in the date range, that would be great. ...
19
3905
by: ali3n8 | last post by:
Hello I have attempted to create a date range report from a query called qrycustomerinformation. The field that contains the value of my date is called Followup. When i run a report on this it is...
5
5380
by: jambonjamasb | last post by:
I am wanting to create a report that summarises the number of items within a date range. For example I have a FIELD called System_Change. This is a drop down COMBOBOX that uses words like unix,...
1
1763
by: ken | last post by:
I'm trying to implement Allen Browne's advice from http://allenbrowne.com/casu-08.html. Unfortunately, I'm getting this error: Run-time error '438': Object doesn't support this property or...
3
3246
by: 6afraidbecause789 | last post by:
If able, can someone please help make a Where clause that strings together IDs in a multi-select listbox AND includes a date range. I wasn’t thinking when I used the code below that strings...
12
3246
smithj14
by: smithj14 | last post by:
I have a form to enter start and end dates then select a worker name to filter a report. This all works fine and when the report is open in preview mode it shows the date range in the txtboxes on the...
3
4997
by: Vinda | last post by:
Hi Bytes, Using a previous question as a base Access 2000 Inserting multiple rows based on a date range. I also wanted to insert multiple rows into a table according to a date range supplied by a...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7303
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7367
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...
1
7018
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7471
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
5613
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,...
1
5028
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.