View Reports List (1 Viewer)

sajarac

Registered User.
Local time
Today, 02:07
Joined
Aug 18, 2015
Messages
126
Hi there, just a quick question:

I have several reports that as a criteria has the following state:

[Forms]![Report1].[MyCategory]
[Forms]![Report2].[MyCategory]
[Forms]![Report3].[MyCategory]
[Forms]![Report4].[MyCategory]

And [MyCategory] = Combo Box with the fiscal years. so When I select to open a report I have to choose a fiscal year then the report gets sorted by that fiscal year.

Now that I have several reports and the list is getting bigger and bigger and would like to incorporate this MS sample "The View Reports selector" which is I like it, but I would also want to add the choice to select first the report then the fiscal year, something like the screen shot provided.

Could someone provide some guidance on how to get this done?

Thanks in advance.


Regards,
 

Attachments

  • FYReport.png
    FYReport.png
    93 KB · Views: 91

Minty

AWF VIP
Local time
Today, 07:07
Joined
Jul 26, 2013
Messages
10,371
See the attached, it's set up to view query's but could equally be used to list reports.

If you get stuck amending it post up what you have tried and we'll see if we can help further.

List Box Selector
 

sajarac

Registered User.
Local time
Today, 02:07
Joined
Aug 18, 2015
Messages
126
Thank you very much for your prompt reply.

I will try. Is not clear to me. I don't need to save the file as a excel file or provide a path. I see everything happens at the double click event. but I don't see where the dates feed the report?


Regards,
 

Minty

AWF VIP
Local time
Today, 07:07
Joined
Jul 26, 2013
Messages
10,371
The Excel save and path for the save are simply other possibilities.

Look at the query design window and you will see the criteria for the dates in the query is set to the form controls;
 

Attachments

  • Report_Criteria.PNG
    Report_Criteria.PNG
    24 KB · Views: 174

sajarac

Registered User.
Local time
Today, 02:07
Joined
Aug 18, 2015
Messages
126
Hi there, thanks again.

I have this cbo box partially working. what is funny is I am able to select the report from my report list, then even if I can not see the values in my cbo box if I select for instance the second one which is FY2019 I can see the report for the FY2019.
 

Attachments

  • FY Selector.png
    FY Selector.png
    4.9 KB · Views: 60

Minty

AWF VIP
Local time
Today, 07:07
Joined
Jul 26, 2013
Messages
10,371
What is the rowsource for your combo, and what are the combo column widths set to? What is the bound column?
 

sajarac

Registered User.
Local time
Today, 02:07
Joined
Aug 18, 2015
Messages
126
SELECT FiscalYear.FiscalYear FROM FiscalYear ORDER BY FiscalYear.FiscalYear DESC;
 

Attachments

  • query.png
    query.png
    9.7 KB · Views: 66
  • query2.png
    query2.png
    12.6 KB · Views: 57

Minty

AWF VIP
Local time
Today, 07:07
Joined
Jul 26, 2013
Messages
10,371
And the column widths ? Under the format tab...
 

sajarac

Registered User.
Local time
Today, 02:07
Joined
Aug 18, 2015
Messages
126
Thank you thank you thank you.

sorry a newbie mistake.

and thanks again for your advice the other two cbo box working in combination works fine!
 

sajarac

Registered User.
Local time
Today, 02:07
Joined
Aug 18, 2015
Messages
126
Downloaded.

thank you, looks really good!!
 

sajarac

Registered User.
Local time
Today, 02:07
Joined
Aug 18, 2015
Messages
126
BTW one last question:

In my view report form I have 3 choices

1. Select a Report to open = Item List
2. Select a fiscal year = cbo box
3. Open a report = cmd button

I was able to disable the command button if the cbo box is empty, but I woould like to disable the cbo box also. I mean once I select the report, cbo enable, once I select the FY command button enable.

Here is the code for the last selection

Private Sub MyCategory_AfterUpdate()
If IsNull(Me.MyCategory) Then
Me.Command1.Enabled = False
Else
Me.Command1.Enabled = True
End If
End Sub

but can't do it for the first one
 

Attachments

  • flow.png
    flow.png
    28.9 KB · Views: 56
Last edited:

Minty

AWF VIP
Local time
Today, 07:07
Joined
Jul 26, 2013
Messages
10,371
It's not so simple with an unbound listbox, as by default something will probably be selected. So there isn't a OnCurrent event you can use .

And what do you do after pressing the cmd button? Deselect everything and start again? I would simply leave it as it is, you have trapped the only error, and having to reselect the date if you wanted to run more than one report would annoy me as an end-user.

You can simplify your code to just ;
Code:
Me.Command1.Enabled = Not IsNull(me.MyCategory)
 

sajarac

Registered User.
Local time
Today, 02:07
Joined
Aug 18, 2015
Messages
126
Thank you very much for your prompt response, and time.

I just changed the code for your proposal, and I will leave as it is so if I select a Fiscal year but no a report I will get a stop all macros warning. not a big deal.

Many thanks!!
 
Last edited:

Minty

AWF VIP
Local time
Today, 07:07
Joined
Jul 26, 2013
Messages
10,371
You can still trap that error and return a message, or just don't try and run the report after the fiscal year update. Wait until the report is clicked, or the button pressed.
 

Users who are viewing this thread

Top Bottom