Some Introductory Programming 1. Structured Query Language (SQL) - used for queries. - a standard database product. 2. Visual Basic for Applications - use of Visual Basic to develop an Access application.
The Access Design Screen version of a Query Show all students with an overall mark less than 40%
The Access SQL version of the query
Run the Query
Example of Visual Basic programming. Calculate outcome, put in field on record. A table contains student number, name, coursework mark, exam mark and an empty field for the result (pass or referred). Module Total = 75% coursework + 25% exam which is shown in a calculated field on the form. Result : 40% or over = Pass, otherwise Referred.
Exam Mark – Properties OnExit – Code Builder
Enter code as below. Note “Text 10” = module total as calculated on form.
Text 10 Properties. Enabled = No (To disallow entry – module total is always calculated by computer).
Run the Form (Enter data)
Let’s add an Exit button
Add a Command Button, call it Exit Use Wizard to specify Close Form action.
The Wizard will insert the following code as an OnClick event procedure:
Add three extra lines to give the following: New lines
Access now asks for confirmation before closing the form.