Sabtu, 14 Januari 2017

Re: [MS_AccessPros] On close event of report can i have more than one option to open a specific form in access 2007

 

Khalid-


My idea is to not have anything on the Main Menu form having to do with reports except the Reports button that opens frmReports.  Rather than labels on the "Reports" form use an Option Group with buttons or check boxes - one per report.  In a blank area of the Reports form, hide whatever parameter controls for each of the reports, and those controls can be overlapping.  When the user picks one of the reports, code behind the Option Group figures out which report, and sets the Visible property of controls needed for parameters to True - and re-hides any revealed by earlier selections.  At the bottom of the form, have one button that has code to figure out the report requested from the Option Group and open it.  Have a second button to return to the Main Menu.

But it sounds like you've designed some of your reports to open a specific dialog form containing the required parameters - and you open the required form in the Open event of the report.  After the user fills in the parameters, the dialog form then hides itself to allow the report to finish opening.  Is this what you've done?  That would explain your code in the report Close event to close the dialog.  That's fine if you want to continue building reports to work like this - but then you shouldn't need any parameters on the Reports. form.  You should be consistent about how you handle report parameters.

John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Jan 14, 2017, at 3:27 PM, khalidtanweerburrah@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



Hi John,

I am getting a little idea what your trying to tell me, but not clear.

My Main Menu design is something like below:

Buttons:
1- Data Entry
2- Add New
3- Modify
4- Reports --> On click opens frm "Reports", it has some Labels defined for specific group of reports.
    On clicking any Label opens another frm having Unbound List box, and further selected report opens.
5- Security
6- Exit
--------------------------
At center of Main Menu i have put labels for reports which are required freqently.

Now my question was that a certain report which is opened through button 4 (Reports) on close returns to the form through
which it was opened, and the same Report which is opened through Label defined for it on Main Menu on close simply opens
Main Menu not the frm having Unbound List box.

Note that the report is same for e.g: Report: "Export Invoice And Packing List".

I have an idea to save that report with other name and that report should open through Label on Main Menu and on its On Close event

Private Sub Report_Close()
    DoCmd.Close acForm, "Dialog Invoice And Packing List"
    DoCmd.OpenForm "Export Documents" <==== I may change it to "MainMenu"
    DoCmd.Restore
End Sub

Is this logical and applicable ?

Regards,
Khalid


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Khalid-

If you have more than one report (and I'm sure there will be others later), have a Reports button on the main menu open a new "menu" form dedicated to reports.  Consider using check boxes in an Option Group to pick the form.  When the user picks a report that requires parameters, unhide the controls on that form to let them enter what is needed.  If you have multiple reports that require parameters, you can even overlap the parameter controls to save space on the form, and then show / hide the controls as appropriate for each selected report.  A Run Report button will actually figure out which report is requested and fire off that report.

John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Jan 14, 2017, at 2:28 PM, Khalid Tanweer khalidtanweerburrah@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



Hi John,

A new situation has arrived to me.

On my frm "MainMenu" i have few command buttons to open certain forms/Reports.

Suppose through button "Reports" we have opened some report, on that reports On Close Event the code is:

Private Sub Report_Close()
    DoCmd.Close acForm, "Dialog Invoice And Packing List"
    DoCmd.OpenForm "Export Documents" <======
    DoCmd.Restore
End Sub

Here at this point can i have any choice that user may be asked whether he wants to open again "Export Documents" OR go to "MainMenu".

This is because my boss has asked me to  put something on Main Menu for "Frequent Inputs/Reports" for this i have put some Labels for 
Frequent Inputs/Frequent Reports, and from there On Click event open the required Form/Report, the desired forms/reports by him.

For the Forms i have put two buttons:
Return To Previous Menu
Return To Main Menu

This fulfills my requirement for forms, but need help for Reports.

Regards,
Khalid






__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar