A macro is a set of one or more actions that each performs a particular operation, such as opening a form or printing a report. Macros can help you to automate common tasks. For example, you can run a macro that prints a report when a user clicks a command button.
To Create Macro: [This macro will open a table in edit mode] |
|
- Select Macros under Objects
- Click New on the 'database window toolbar'
- Select OpenTable for Action field
- Select Table Name: NewEmployee (or your choose) from Action Arguments
- Select View: Datasheet from Action Arguments
- Select Data Mode: Edit from Action Arguments
- Save the macro with a unique name, as – NewEmployeeEdit (or your choose)
- Close the macro 'design window'
To Create Macro: [This macro will open a table in add mode] |
|
- Select Macros under Objects
- Click New on the 'database window toolbar'
- Select OpenTable for Action field
- Select Table Name: NewEmployee (or your choose) from Action Arguments
- Select View: Datasheet from Action Arguments
- Select Data Mode: Add from Action Arguments
- Save the macro with a unique name, as – NewEmployeeAdd (or your choose)
- Close the macro 'design window'
To Create Macro: [This macro will open a report in print preview mode with page setup and print dialog box] |
|
- Select Macros under Objects
- Click New on the 'database window toolbar'
- Select OpenReport for 1st Action field
- Select Report Name: NewEmployeeReport (or your choose) from Action Arguments
- Select View: Print Preview from Action Arguments
- Select Window Mode: Normal from Action Arguments
- Select RunCommand for 2nd Action field
- Select Command: PageSetup from Action Arguments
- Select RunCommand for 3rd Action field
- Select Command: Print from Action Arguments
- Save the macro with a unique name, as – NewEmployeePrint (or your choose)
- Close the macro 'design window'
- Select Macros under Objects
- Select a macro, as – NewEmployeePrint (or your choose)
- Click Run on the 'database window toolbar'
To Set a Macro under a Command Button: |
|
- Select Forms under Objects
- Select a form, as – NewEmployee (or your choose)
- Click Design on the 'database window toolbar'
- Select Command Button from Toolbox and click on the form
- Select Categories: Miscellaneous and Actions: Run Macro > Click Next button > Select the macro, as – NewEmployeeEdit (or your choose) > Click Next button > Type Text: Open Table Edit Mode > Click Next button > Type button name: new_employee_table_edit > Click Finish button
- Select Command Button from Toolbox and click on the form
- Select Categories: Miscellaneous and Actions: Run Macro > Click Next button> Select the macro, as – NewEmployeeEdit (or your choose) > Click Next button > Type Text: Open Table Add Mode > Click Next button > Type button name: new_employee_table_add > Click Finish button
- Select Command Button from Toolbox and click on the form
- Select Categories: Miscellaneous and Actions: Run Macro > Click Next button > Select the macro, as – NewEmployeeEdit (or your choose) > Click Next button > Type Text: Print Report > Click Next button > Type button name: new_employee_report_print > Click Finish button
- Save the form and close the design window
- Open the form and click Print Report button to run macro
A data access page is a special type of Web page designed for viewing and working with data from the Internet or an intranet— data that is stored in a Microsoft Access database or a Microsoft SQL Server database. The data access page may also include data from other sources, such as Microsoft Excel.
To Create Page with Page Wizard: |
|
- Select Pages under Objects
- Click New on the 'database window toolbar'
- Double click on Form Wizard
- Select Employee table (or your choose) from Tables/Queries list > Select fields from Available Fields: list to Selected Fields: list > Click Next button
- Click Next button
- Click Next button
- Type a title for the page > Select 'Open the page' > Click Finish button
- Save the page with a unique name
To Create Page with AutoPage: Columnar: |
|
- Select Pages under Objects
- Click New on the 'database window toolbar'
- Select AutoPage: Columnar > Select a table or query > Click Ok button
- Save the page with a unique name
- Make sure in your database has Authors and Books table with relation, Author form, Books form, multi-form (Authors and Books), Authors report
- On the Tools menu, point to Database Utilities and click Switchboard Manager
- Click Yes button
- Click Edit … button
- Click New… button
- Type Text: Authors (or your choose) > Set Command: Open Form in Edit Mode (or your choose) > Set Form: Authors (or your choose)
> Click Ok button
- Click New… button
- Type Text: Books (or your choose) > Set Command: Open Form in Edit Mode (or your choose) > Set Form: Books (or your choose)
> Click Ok button
- Click New… button
- Type Text: Authors and Books (or your choose) > Set Command: Open Form in Edit Mode (or your choose) > Set Form: Authors and Books (or your choose)
> Click Ok button
- Click New… button
- Type Text: Report (or your choose) > Set Command: Open Report (or your choose) > Set Report: Authors (or your choose)
> Click Ok button
> Click Close button
- Click Close button
To Set Switchboard as Startup Form: |
|
- On the Tools menu, click Startup…
- Set Display Form/Page: Switchboard
> Click Ok button
- Minimize the 'database window'
- Exit Access
- Again open Microsoft Office Access 2003
- Open the Database
|