Learn Microsoft Access Advanced Programming Techniques, Tips and Tricks.

Control Screen Menu Design

Introduction

We have seen in the earlier topic on Control Screen Design that we can display several Menus at one place. Let us look into a simple design with 2 Menus and how they can be displayed at the same place interchangeably. We need two Tables, one for Data Files List and another one for Reports' List. You can use the same Table that we have created for the Opening Access Forms topic. Make a copy of it and rename it as ReportList.


The Design Task

  1. Open a New Form in design View.
  2. Click on the Tab Control Button on the Toolbox and draw a Tab Control on the new form's detail section as shown below:
  3. Click on the second page of the tab control where page2 is shown and display the property sheet. Type Reports in the Caption Property.
  4. Click on Page1 and Type Data Files in the Caption Property.
  5. Now we need to create a List Box. Before clicking on the Listbox button on the Toolbox ensure that the Control Wizard (the button next to the arrow button) is selected on the Toolbox.
  6. When you point the arrow on the Tab control Page, after selecting the listbox control, the Tab Control Page will highlight with a black background where you can position your listbox. Draw a Listbox with the size of your choice.
  7. The Listbox Wizard starts up. Select the Data Files Table and select Seq & Desc Fields from the Table and click Next. Select Seq field for sorting in Ascending Order and click Finish.

    We needs to re-organize the Listbox and the Tab Control as its size and placement have changed. Select the child label of the listbox and delete it. Click outside the Tab Control and drag the mouse over it (or click on right of the tab-page projections, right of page2) to select the Tab Control and drag it towards right, giving enough space at left side for creating Command Buttons later, if its position was changed too close to the left border. Change the Listbox's size to your liking.

    We are concentrating only on the designing aspect of the controls not running its options from the listbox, which we have already discussed under the topic Opening Access Forms.

  8. Click on the Listbox and display its Property Sheet. Note down the following Property Values:
    • Left
    • Top
    • Width
    • Height

    We need to create a 2nd Listbox on 2nd Page of the Tab Control. Instead of going through the wizard method we will do it differently.

  9. Right-click on the Listbox on first page and select copy from the shortcut menu.
  10. Click on the 2nd Page (Reports) tab to select it, press and hold the Shift Key then right-click on the tab page and select paste from the short cut menu. The List box from the first page is copied to the 2nd page. To change its Row Source, display the property sheet and click on the Row source property and select the build (. . .) button at the right side. The Query Design window is On with the DataFiles Table in it. Click on the Show Table Button on the Tool Bar above and select the ReportList Table. Change the Fields and the Table Names in place of Datafiles table to ReportList Table and Fields. Delete the Datafiles table from the design and close the window to save the changes.
  11. Display the Property Sheet of the Listbox of 2nd Page, if it is not already visible, and change the values of the above properties (Top, Left, Width & Height) to the same value that we have noted down from first page. Change the Fill Color and the Font Color to something different like blue background and white font color.
  12. Select the tab control using one of the methods explained under item 7 (2nd paragraph text in bold italics) above and display the property sheet. Change the following Property values:
    • Name = TabCtl0 (Zero at the end)
    • Back Style = Transparent
    • Multirow = No (default)
    • Style = Buttons

    View the Changes Done So Far.

  13. Save the Form and open it in Form View. Because of the above property change you can hardly say it is a Tab Control. Click on the buttons on the top one after the other to display the Data Files & Report Menus and we can see both the menus are sharing the same space for displaying their contents.
  14. If you don't like the Buttons on the top, create two Command Buttons at the left side, one below the other. Name the First one as cmdDF and change its Caption to Data Files. Name the second Button as cmdRpt and change its Caption to Reports.
  15. Select the first Command Button and display the Property Sheet. Add a line of code in the On Click Event Procedure:
Private Sub cmdDF_Click()
   Me.TabCtl0.Pages(0).SetFocus
End Sub

Write the following code in the On Click Event Procedure of the 2nd Command Button:

Private Sub cmdRpt_Click()
   Me.TabCtl0.Pages(1).SetFocus
End Sub

We need to make one more change on the Tab Control's Style Property Value = None

to make the top Buttons to disappear and then save the Form. Open it in Form view and try out your design.

If you need more menus, you can add more Tab Control Pages from the Insert Menu after selecting the Tab Control. Repeat the design process with Listboxes and Command Buttons as explained above.

Share:

1 comment:

  1. [...] a Look at the following two Blog Posts: Control Screen Menu Design Drill-down Inquiry Screen __________________ http://www.msaccesstips.com (Learn MS-Access Tips [...]

    ReplyDelete

Comments subject to moderation before publishing.

MS-Access Tips on your Finger-Tip

  • Download Android App 'MSA Guru' Version of LEARN MS-ACCESS TIPS AND TRICKS from Google Play Store.

Want to Post Free Ads on the Web


Translate



PageRank
Subscribe in a reader
Your email address:

Delivered by FeedBurner

Search

Popular Posts

Blog Archive

Powered by Blogger.

Follow by Email

Labels

Forms Functions How Tos MS-Access Security Reports msaccess forms Animations msaccess animation Utilities msaccess controls Access and Internet MS-Access Scurity MS-Access and Internet Class Module External Links Queries Array msaccess reports Accesstips WithEvents msaccess tips Downloads Menus and Toolbars Objects Collection Object MsaccessLinks Process Controls Art Work Property msaccess How Tos Dictionary Object Graph Charts Query VBA msaccessQuery Calculation Combo Boxes Event List Boxes Command Buttons Controls Data Emails and Alerts Form Custom Functions Custom Wizards DOS Commands Data Type Object Reference ms-access functions msaccess functions msaccess graphs msaccess reporttricks Command Button Key Report msaccessprocess security advanced Access Security Add Auto-Number Field Type Form Instances Item Macros Menus RaiseEvent Recordset Top Values Variables Wrapper Classes msaccess email msaccess menus progressmeter Access2007 Copy Excel Export Expression Fields Join Methods Microsoft Numbering System Records Security Split SubForm Table Tables Time Difference Utility Workgroup database function msaccess wizards tutorial Access Emails and Alerts Access Fields Access How Tos Access Mail Merge Access2003 Accounting Year Action Animation Attachment Binary Numbers Bookmarks Budgeting ChDir Color Palette Common Controls Conditional Formatting Data Filtering Database Records Defining Pages Diagram Disk Dynamic Lookup Error Handler External Filter Formatting Groups Hexadecimal Numbers ImageList Control Import Labels List ListView Control Logo Macro Mail Merge Main Form Memo Monitoring Nodes Octal Numbers Operating System Paste Primary-Key Product Rank Reading Remove Rich Text Sequence SetFocus Summary Tab-Page TreeView Control Union Query User Users Water-Mark Word automatically commands hyperlinks iSeries Date iif ms-access msaccess msaccess alerts pdf files reference restore switch text toolbar updating upload vba code