Week 8 Using the Access GUI and macros to create a prototype - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Week 8 Using the Access GUI and macros to create a prototype

Description:

To be able to create a high level overview of all the forms (screens) To be able to navigate between them ... This means that it recognises user's interactions ... – PowerPoint PPT presentation

Number of Views:31
Avg rating:3.0/5.0
Slides: 12
Provided by: Phili133
Category:

less

Transcript and Presenter's Notes

Title: Week 8 Using the Access GUI and macros to create a prototype


1
Week 8 Using the Access GUI and macros to create
a prototype
2
Outcomes
  • To be able to create a high level overview of all
    the forms (screens)
  • To be able to navigate between them using macros
  • To be able to open an application directly onto a
    menu screen using the autoexec macro

3
Macros
  • Microsoft Access uses an event-driven programming
    paradigm
  • This means that it recognises users interactions
  • e.g.with a mouse action-pressing down or clicking
    a mouse button on a form object such as a button
    or label.
  • Other events can be when data is entered, deleted
    or changed

4
Using macros
  • We will use macros to link our forms and open the
    pages when a button is pressed or other event
    triggered.
  • So far we have only used one form. You will now
    add buttons to the form and use these to navigate
    from one form to another using a macro a
    pre-programmed piece of code designed to perform
    various tasks (opening and closing forms, opening
    reports etc.)

5
High level prototype
  • You can use the forms in Access to produce a
    high-level prototype of your system, either the
    group assignment or one of your own design. The
    aim is to
  • Open the system so that the users are presented
    with a usable front page with navigation to the
    other pages (forms) instead of the underlying
    tables and database that you will probably want
    to hide from the client.

6
Create a new form within an existing database
  • Using the Student database, create a new form,
    not with a wizard but in design view.
  • Save this as form1 and add a label to the form
    and type in the caption STUDENT REGISTRATION
  • Use the properties feature of the label to change
    its font size and background colour (back color)
    and alignment.

7
First you need an object to trigger an event e.g.
a button
  • Add a command button to the form. This will
    prompt a wizard press cancel (Figure 6.2).

8
  • When you run the form nothing happens when you
    click on this button. This is because we have not
    added a piece of code to trigger an event. To do
    this we need to add a macro.
  • Go to macros, click on New. In the Action box
    select OpenForm and go to the bottom of the page,
    click on Form Name and select Students on Modules

9
The new macro form
1 Select pre-written functions eg openform
3 Save the macro as a meaningful name e.g.
openmain
2 Select the form to be opened
10
Next connect the macro to the object (the button)
  • Open form1 if you are using a new form in design
    view and click on the button. Right click to get
    properties, select event.
  • Scroll down to the on click event, click on the ?
    and select the name of the macro
  • Close and save the form.
  • Open the form and test the button. When pressed
    the students on module form should open.
  • Now open the Students on modules form in design
    view and add a button and a macro to navigate
    back to the form1.

11
Tutorial
  • Try Exercise 6.1 on p 69 of the tutorial booklet.
  • Experiment with other macros such as for your
    prototype of your system for the assignment.
Write a Comment
User Comments (0)
About PowerShow.com