<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener("load", function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <iframe src="http://www.blogger.com/navbar.g?targetBlogID=34083602&amp;blogName=LEARN+MS-ACCESS+TIPS+AND+TRICKS&amp;publishMode=PUBLISH_MODE_FTP&amp;navbarType=BLUE&amp;layoutType=CLASSIC&amp;searchRoot=http%3A%2F%2Fblogsearch.google.com%2F&amp;blogLocale=en_US&amp;homepageUrl=http%3A%2F%2Fwww.msaccesstips.com%2F" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" allowtransparency="true" title="Blogger Navigation and Search"></iframe> <div></div>
www.msaccesstips.com

LEARN MS-ACCESS TIPS AND TRICKS


International Response Fund

LEARN MS-ACCESS TIPS AND TRICKS

↑ Grab this Headline Animator

Your Ad Here
Friday, January 23, 2009

Drill-Down Inquiry Screen-2

This is the continuation of earlier Article: Drill-Down Inquiry Screen. If you have landed on this Page please read the first part of this Article by following this Link: Drill-Down Inquiry Screen and continue...


I hope you have downloaded the sample database from the bottom of the first part of this Article and tried it out. Then you have a general idea of the shape of things to come.


Here, we will design three small Forms, assemble them on the Main Form on a Tab Control and use few lines of Code to refresh the Main Form to update the contents of the Sub-forms before bringing them into view.


First, we will design the top layer of the Form for the Employee-wise Order Summary Information.


03_Employee_Summary Form

  1. Select the Query 03_Employee_Summary.


  2. Design a Tabular Form (continuous form) like the sample given below. You may use the Form Wizard from Insert Menu to create the Form quickly but it may insert background images and the controls may be created with shadows etc. In that case you have to modify the design to look like the sample given below.



  3. Employee Order Summary Form Image



  4. Select all the Data Fields together by clicking on the left side border of Detail Section or click in Detail Section somewhere and drag the mouse over all the controls to select them together.


  5. Display the Property Sheet (View - ->Properties).

  6. Change the following Property Values:



    • Enabled = No

    • Locked = Yes

    • Tab Stop = No

    • Back Color = 12632256

    • Special Effect = Raised



  7. Expand the Detail Section of the Form down to get enough room to draw a lengthy Command Button.


  8. Draw a Command Button as wide as the full length of all the Fields above, so that we can cover the fields by placing it over them.

  9. Display the Property Sheet of the Command Button.

  10. Change the following Property Values:




    • Name = cmd1

    • Transparent = Yes

    • Hyperlink SubAddress = #


  11. We must make the Command Button's height same as of the Fields above. Click on the Command Button to select it, hold the Shift Key and click on any one of the Fields above to select it along with the Command Button. Alternatively you can click and drag over the Command Button and any one of the fields above.


  12. Select Format - -> Size and select Shortest, if Command Button's height is more than the field, or select Tallest to make the Command Button as tall as the fields above.


  13. Drag the Transparent Command Button and place it over the Fields above.

  14. To make sure that the Transparent Command Button stays above all the data fields, select Format - - > Bring to Front.

  15. Now, reduce the Detail Section height, but there must be little gap above and below the Data Fields.

  16. Draw a Text Box in the Form Footer Section below in the same position of TORDERS field in the Detail Section and write the following expression in the Control Source Property:


  17. =Sum([TORDERS])

  18. Change the Caption of the child label to Total Orders.

  19. Create a Label at the Header of the Form and change the Caption value to EMPLOYEE-WISE ORDERS SUMMARY. Change the font size to 12.

  20. Display the Code Module of the Form ( View - -> Code), Copy and paste the following VBA lines into the Module:


  21.  
    Private Sub cmd1_Click()
    Me.Parent.Refresh
    Me.Parent.Tabctl0.Pages(1).SetFocus
    End Sub


  22. Save the Form with the Name: 03_Employee_Summary.



04_Order_ListQ Form

  1. Select the Query 04_Order_ListQ and create a Tabular Form (continuous Form) as we did at the top.

  2. Change the design to look like the sample Image given below:


  3. Order List Form Image

  4. Select all the fields as we did earlier and change the following Property Values:




    • Enabled = No

    • Locked = Yes

    • Tab Stop = No

    • Back Color = 16777215

    • Special Effect = Flat




  5. Follow Step-6 to 8 given above.

  6. Change the following Properties of the Command Button:




    • Name = cmdOrder

    • Transparent = Yes

    • Hyperlink SubAddress = #




  7. Follow Step-10 to 13 explained above. Reduce the height of the Detail Section without leaving gap above and below the fields.

  8. Create a Command Button at the Footer Section of the Form.

  9. Display the Property Sheet of the Command Button and change the following Property Values:




    • Name = cmdMain

    • Caption = Goto Main



  10. Expand the Header Section of the Form and drag the Field Headings down to get enough room to create a Heading to the Form.


  11. Add a Text Box above the Field Headings and write the following expression in the Control Source Property of the Text Box:


  12. = "Order List of " & [EmpName]

  13. Display the Code Module of the Form (View - - >Code), Copy and paste the VBA Code given below into the Module and save the Form with the name 04_Order_ListQ.



Private Sub cmdMain_Click()
Me.Parent.Tabctl0.Pages(0).SetFocus
End Sub


Private Sub cmdOrder_Click()
Me.Parent.Refresh
Me.Parent.Tabctl0.Pages(2).SetFocus
End Sub


05_Order_DetailQ Form.

  1. Select the Query 05_Order_DetailQ and Create a Tabular Form.


  2. Here, we don't need the Transparent Command Button. Change the design of the form to make it like the sample image given below.


    Order Detail Screen Image


  3. Create a Text Box in the Form Footer below the Quantity field and write the following expression in the Control Source Property:


  4. =Sum( [Quantity])

  5. Create another Text Box in the Form Footer below the ExtendedPrice Column and write the following expression in the Control Source Property:


  6. =Sum([ExtendedPrice])

  7. Create a Command Button in the Form Footer below the Text Boxes.


  8. Change the following Property Values of the Command Button.



    • Name = cmdBack

    • Caption = << Back




  9. Display the Code Module of the Form (View - -> Code), copy and paste the following lines into the Module:



  10. Private Sub cmdBack_Click()
    Me.Parent.TabCtl0.Pages(1).SetFocus
    End Sub

  11. Save the Form with the Name 05_Order_DetailsQ.



Now, we are ready for the Main Form Inquiry_Main to assemble all the three Sub-Forms on a Table Control and make the Tab Control invisible.


Inquiry_Main Form

  1. Select the Parameter Table Date_Param, select Form from Insert Menu and select Design View from the displayed List.


  2. Select the Tab Control Tool from the Toolbox and draw a Tab Control on the Detail Section of the Form.

  3. Check the sample image given below. The Tab Control will have only two pages when created but we need one more page.


  4. Inquiry Main Screen Image

  5. Click on the Tab Control to select it and select Tab Control Page from Insert Menu.


  6. You may select each Page of the Tab Control, display their Property Sheet and Change the Caption Property value of Page1, Page2 and Page3 as Summary, Orders and Order Detail respectively, if needed. It is used for reference purposes only and will not use those names anywhere or display them either.


    Next step is to drag and drop the Sub-Forms (03_Employees_Summary, 04_Order_ListQ and 05_Order_DetailQ) one by one on the Tab Control Pages.


  7. Position the Database Window with the Forms Tab active and the Inquiry_Main Form with the Tab Control side by side.

  8. Drag and drop the 03_Employee_Summary Form on the Tab Control Page1.


  9. You may delete the child label attached to the Sub-Form. Re-size the Sub-Form and Tab Control to display the contents properly on the Screen. You may save the Form with the name Inquiry_Main and open it in Normal View to check as how the Information is displayed on the Sub-Form. If necessary increase or decrease the size of the Form and Tab Control. Leave some gap between the Tab control and the top of the Detail Section of the Form to insert few Text Boxes for StartDate and EndDate fields and two more Text Boxes for control purposes. We need space for a heading above these controls as well.

  10. When you are satisfied with the Sub-Form dimension for the design, click on the Sub-Form and display the Property Sheet. Take a piece of paper and note down the following Property Values for resizing and positioning the other two forms we are going to insert into Page2 and Page3 of the Tab Control.




    • Top

    • Left

    • Width

    • Height



  11. Right-click on the Sub-Form and select Copy from the displayed Shortcut Menu.

  12. Select Tab Control Page2, press and hold Shift Key, right-click on the Tab Control Page2 and select Paste from the displayed menu.
    The pasted control will be an empty form displaying the Source Object Name of the copied Form with white background.


  13. Display the Property sheet of the Form and change the Source Object Property value to 04_Order_ListQ. After this change the Form will appear on the Tab Control Page2.


  14. Change the dimension property values to the same value you have noted down. Since, you have copied the Form (no drag and drop from Database Window); you need to change only the Top and Left Property Values, Width and Height values will be same. If not then change it.

  15. Follow Step-9 to 12 above to bring in the 05_Order_DetailQ Form into the third Page of the Tab Control.

  16. Display the Field List (View - ->Field List), if it is not visible.

  17. Drag and drop StartDate and EndDate field above the Tab Control, create labels above and left and change their Caption values as shown on the design above.

  18. Create a Command Button to the right of EndDate field and change its property values as given below:




    • Name = cmdRefresh

    • Caption = <<Refresh Screen




    The Date Fields we have created and another two Text Boxes, which we are going to create, will be referenced in the Queries we have created earlier to filter the data for the Forms to display. Even though this refresh action is not necessary, as we do that before we display the results, it is an additional feature to refresh the changes manually by the User.


  19. Create a Text Box to the right of the Command Button and display its property sheet and change the following Property Values:




    • Name = EID

    • Control Source = =[03_Employee_Summary].Form!EmployeeID

    • Visible = No



  20. Create another Text Box below the earlier one and change the property values as given below.




    • Name = OID

    • Control Source = =[04_Order_ListQ].Form!OrderID

    • Visible = No



  21. Create a heading on top of the Form with the Caption Value SALES PERFORMANCE INQUIRY.

  22. Create a Command Button below the Tab Control and change the following property values:




    • Name = cmdQuit

    • Caption = Quit



    Now, we are going to make the Tab Control disappear, well the Tab Control will not look like a Tab Control after the change, to be exact.

  23. Click on the Tab Control, display the Property sheet and change the following property values:


  24. Caution: Immediately after you change the Property values make a point to click the Save Toolbar Button or select Save from File Menu to save the changes. There is a tendency to lock-up the Form in Office2000, if you attempt to do anything else.




    • Back Style = Transparent

    • Multirow = No

    • Style = None




  25. Display the Code Module of the Form, copy and paste the following few lines of Code into the Module:



  26. Private Sub cmdQuit_Click()
    DoCmd.Close acForm, Me.Name
    End Sub


    Private Sub cmdRefresh_Click()
    Me.Refresh
    End Sub


    Private Sub EndDate_LostFocus()
    Me.Refresh
    End Sub


    Private Sub Form_Load()
    Me.TabCtl0.Pages(0).SetFocus
    End Sub


  27. We will finish the design by setting the Property Values of the Inquiry_Main Form. Display the Property Sheet of the Form and change the following Property Values:




    • Allow Edits = Yes

    • Allow Deletiions = No

    • Allow Additions = No

    • Data Entry = No

    • Scroll Bars = Neither

    • Record Selectors = No

    • Navigation Buttons = No

    • Dividing Lines = No

    • Auto Re-size = Yes

    • Auto Center = Yes

    • Pop up = Yes

    • Modal = No

    • Border Style = Dialog

    • Control Box = Yes

    • Min Max Buttons = None

    • Close Button = Yes

    • Allow Design Changes = Design View Only



  28. Save the Form, open it in Normal View and try out your creation.


Note: If you face any difficulty in running your design normally, use the downloaded database as reference, find the mistake and correct it.




StumbleUpon Toolbar



Text Box and Label Inner Margins
Multiple Parameters for Query
Form Menu Bars and Toolbars
Seriality Control - Missing Numbers
Wave Shaped Reminder Ticker

Labels:

0 Comments:

Post a Comment

Note:Comments subject to Review by Blog Author before displaying.

Links to this post:

Create a Link

<< Home


Creative Commons License
Learn MS-Access Tips and Tricks by msaccesstips.com is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 India License.



This Page is best viewed with 1280 x 1024 Resolution

   FEATURED LINKS
SITEMAP
Command Button Animation
3D Headings on Forms
MsgBox & Office Assistant
Reminder Ticker
MS-Access & E-Mails
Automated E-Mail Alerts
MsgBox with Options Menu
Colorful Command Buttons
Configure Lotus Notes
Alerts through Network
Running this site has become a costly affair as the revenue from Ads is not sufficient to support it. If you find these pages informative & useful and would like to extend a helping hand, then please do it here.





Link Back to us with this Button

Learn MS-Access

Copy and Paste this HTML Code in your Webpage


Add to Technorati Favorites

Programming Blogs - Blog Catalog Blog Directory
Powered by FeedBurner
Add to Google

Software
Computers blogs
TopOfBlogs




AddMe - Search Engine Optimization Submit Your Site Free!
Go BlogZ Ave Blogs
eBlogzilla Changing LINKS
LS Blogs Blogarama
blog search directory BlogUniverse
Find Blogs in Directory RSS Directory
blogskinny.com ShowcaseBlogs.com
Amfibi

Search Engine Optimization and SEO Tools
Dmegs Web Directory Takeaway for Sale Businesses For Sale
Free Submission Directory Free site submission

Free Listing
 





Free Page Rank Checker

AddThis Social Bookmark Button

Enter your email address:

Delivered by FeedBurner



Top Blogs


Microsoft Access is the Jewell among MS-Office suite of Applications. Its Security features are excellent and works fine in Network environment. MS-Access can link/upload data from any Data Source. Applications that you design should be user-friendly and visually pleasing too. Here I would like to share my experience in Microsoft Access Programming with you and I am sure that you will find them interesting too.

My Photo
Name: Ramachandran Pillai
Location: Cochin, India

I am not an Access Guru and not through MS-Access yet. More to learn and I don’t think that aspect has any end because others have their own style of using this tool. We can learn lot more tricks, other than what we already know, from others too. My programming skills in COBOL, BASIC, Turbo-C, dBase, FoxPro, Visual Basic & Basic HTML attained through self-learning. I wrote my first COBOL Program in 1975 for ICL1901, 3rd Generation Main Frame Computer. Worked as a Computer Operator (NCR VRX8555 Mainframe Machine upto 1990) with M/s. Y.B.A. Kanoo, Saudi Arabia. Started using MS-Access Ver.2 in 1996, when dBase III+ and Foxbase (later version Foxpro) were my favorite DBMS. During Last 13 Year period I have developed more than 45 In-House Applications (medium & small) under MS-Access for our Organization, a leading Automotive Company in Oman. All the Applications are fully Secured and runs under Windows Network. It is my pleasure to share my experience with others. Anything interesting that you would like to share with me, please do. My E-mail Address: aprpillai@msaccesstips.com


If you need a Demo of any of the Topic explained here, send me an E-mail to: aprpillai@msaccesstips.com
with the Topic Description, I shall try to send a sample database to you.


Access Tips | Email | Reports | Report Tricks | Graphs | Forms | Menus | Animation | Security | Internet | How TOs | Linking | Query | Progress Meter | Alerts | Process Tips | Access Functions |




Site Designed by:www.msaccesstips.com