Integrated Business Applications with Databases (D3) Jenny Pedler

Slides:



Advertisements
Similar presentations
1 VBA Introduction. Basic Components 2 VBA LANGUAGE OFFICE OBJECTS EXCEL OBJECTS ACCESS OBJECTS WORD OBJECTS OUTLOOK OBJECTS POWERPOINT OBJECTS.
Advertisements

Object Oriented Programming A programming concept which views programs as objects with properties and ways to manipulate the object and the properties.
Some computer fundamentals and jargon Memory: Basic element is a bit – value = 0 or 1 Collection of “n” bits is a “byte” Collection of several bytes is.
AE6382 VBA - Excel l VBA is Visual Basic for Applications l The goal is to demonstrate how VBA can be used to leverage the power of Excel u VBA syntax.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Customisation The GUI in most GIS applications is sufficient for most needs. However, situations arise where you want either to: –Modify the interface,
VBA Modules, Functions, Variables, and Constants
Basics of ASP.NET. 2 © UW Business School, University of Washington 2004 Outline Installing ASP.NET and Web Matrix Data Types Branching Structure Procedures.
CVEV 118/698 Visual Basic Lecture 1 Prof. Mounir Mabsout Expert 1: Elsa Sulukdjian Expert 2: Walid El Asmar.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
SUNY Morrisville-Norwich Campus-Week 12 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
Using the Visual Basic Editor Visual Basic for Applications 1.
Visual Basic: An Object Oriented Approach 4: Simple Programming in VB.
Data Types and Operations Programming Fundamentals (Writing Code)Programming Fundamentals (Writing Code)
VB Code Statements 3 types of VB statement The Remark statement, known as comments, are used for project documentation only Begin with an apostrophe Not.
Access VBA Programming for Beginners - Class 1 - by Patrick Lasu
VBA & Excel Barry L. Nelson IEMS 465 Fall Quarter 2003.
Apply Sub Procedures/Methods and User Defined Functions
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Automation Testing- QTP Rajesh Charles Batch No: Date: jan
VBA – Visual Basic for Applications Week 20 - Tutorial.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
XP Chapter 7 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Enhancing User Interaction Through Programming Chapter.
Mr C Johnston ICT Teacher BTEC IT Unit 06 - Lesson 05 Learning To Program.
Automating Tasks with Visual Basic. Introduction  When can’t find a readymade macro action that does the job you want, you can use Visual Basic code.
Tutorial 11 Using and Writing Visual Basic for Applications Code
Enhancing User Interaction Through Programming
The animation is already done for you; just copy and paste the slide into your existing presentation. Dony Pranadiyanta, ST.
Variable, Expressions, Statements and Operators By: Engr. Faisal ur Rehman CE-105 Fall 2007.
® Microsoft Access 2010 Tutorial 11 Using and Writing Visual Basic for Applications Code.
PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC BUILDING BLOCKS Bilal Munir Mughal 1 Chapter-5.
National Diploma Unit 4 Introduction to Software Development Data types, variables and constants.
Using Visual Basic for Applications (VBA) – Project 8.
Chapter 4: The Selection Process in Visual Basic.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 11 Committed to Shaping the Next Generation of IT Experts. Chapter 10 Customizing a Database.
Lab 01 Forms in excel Tahani ALdweesh Insert form into your project. 2. Change form’s properties. 3. Put controls on the form. 4. Change controls’
Access VBA Programming for Beginners - Class 2 - by Patrick Lasu
Programming Test #1 Solutions. Multiple Choice 1. B) the grammar of the coding language 2. C) String 3. A) Single 4. C) 2Burgers4Me 5. B) Design Time.
Using Visual Basic for Applications in Microsoft Project Sean Vogel.
Introduction to VB.NET 2005 Dr. McDaniel IDS4704 Spring 2005.
Applications Development
Data Types and Variables. Data Type! Computers are all about Data! Data can be in the form of Text Dates Sounds Pictures.
CS 101 Test 2 Study Guide Acronyms RAD - Rapid Application Development IDE - Integrated Development Environment GUI - Graphical User Interface VB - Visual.
VB for applications. Lesson Plan Fundamentals of VB VB for handling events in Access.
Chapter-1 Introduction to Visual Basic GUI- A GUI is a graphical (rather than purely textual) user interface to a computer. The term came into existence.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Visual Basic Programming I 56:150 Information System Design.
CompMathBSc, English 5 October 2006 Programming basics — continued  Arrays  Cycle Statements: Loops  Control Structures vs Conditions  Subs: Procedures.
Understanding Visual Basic Fundamentals CHAPTER 13 Understanding Visual Basic Fundamentals.
INTRODUCTION CHAPTER #1 Visual Basic.NET. VB.Net General features It is an object oriented language  In the past VB had objects but focus was not placed.
COMPREHENSIVE Access Tutorial 11 Using and Writing Visual Basic for Applications Code.
Creation of Variables with Numeric, alphanumeric, date, picture, memo data types Constant - A quantity that does not change during the execution of a program.
CIS 338: VB Variables Dr. Ralph D. Westfall April, 2011.
Automation Testing- QTP Rajesh Charles Batch No: Date: jan
Visual Basic Fundamental Concepts
A variable is a name for a value stored in memory.
VBA - Excel VBA is Visual Basic for Applications
VBA - Excel VBA is Visual Basic for Applications
Visual Basic 6 (VB6) Data Types, And Operators
2. Understanding VB Variables
Microsoft Access 2003 Illustrated Complete
Microsoft Access Illustrated
Objectives Learn about Function procedures (functions), Sub procedures (subroutines), and modules Review and modify an existing subroutine in an event.
Exploring Microsoft Office Access 2007
VISUAL BASIC.
Visual Basic..
CS285 Introduction - Visual Basic
Tutorial 11 Using and Writing Visual Basic for Applications Code
Presentation transcript:

Integrated Business Applications with Databases (D3) Jenny Pedler

Session 1: VBA Coding Basics Components of the VBA development environment Variable types and naming Sub and Function procedures Private and Public procedures Debugging your code Using the VBA Help facility

Add more complex logic to event handlers More actions available than for macros Integrate with other Office applications through automation Executes faster than equivalent macro action Can trap errors and provide custom error- handling Easier to read and print out than macros Advantages of using VBA

VBA is… A programming language A subset of VB (Visual Basic) Object-oriented? –Encapsulation –Encapsulation –Inheritance –Inheritance –Object-enabled Event-driven

VBA IDE Project Explorer Property window Code window Procedure list Object list Immediate window Locals window Watch window View selection buttons

Modules Form/Report Modules –Belong to specific form or report –Procedures are generally private Standard Modules –Modules pane of main database window –General-purpose code –Can be used by any form/report in database

Procedures Sub –Performs an action but does not return a value Function –Returns a value –May also perform an action

Variables Use Dim statement to declare variables Use As to define data type Use naming convention E.g. –Dim strName as String –Dim datToday as Date

VBA Data Types Boolean Logical variables - values are True or False Integer These are short (16 bit) integers. Long These are long (32 bit) integers. Currency Used for quantities which consist of a whole number combined with a fraction with a fixed number of decimal places. As the name implies, they are useful for dealing with monetary values. Single These are floating point values, providing around 6 significant figures of accuracy. Double These are floating point values, providing around 14 significant figures of accuracy. Date A date variable is composed of two floating pointing values, one containing a date and the other containing the time of day. String Variable length character strings. Variant A variant variable can contain any of the above data types. Variant data variables change their type dynamically according to what is stored in them. Note that variables are assumed to be Variant unless specifically declared to be something else.

Event handlers Event handler –VBA code (or macro) to be executed when a specific event happens to a specific object Event property –Mechanism to allow us to attach event handler to specific event for specific object –Event tab on objects property sheet lists events that an object can respond to

DoCmd object Runs Access actions from VBA –Macro – actions –VBA – methods DoCmd methods are VBA equivalent of macro actions

If [condition] Then statements to be executed End If If [condition] Then statements to be executed Else default statements to be executed End If If [condition] Then statements to be executed Else If [condition] Then alternative statements to be executed Else default statements to be executed End If Conditional Execution: If

Select Case statement Syntax Select Case testexpression [Case expressionlist-n [statements-n]]... [Case Else [elsestatements]] End Select