Microsoft Access Using Visual Basic Routines. Visual Basic Datatypes Boolean Byte Currency Date Double Integer Long Object Single String Variant Hyperlink.

Slides:



Advertisements
Similar presentations
Integrated Business Applications with Databases (D3) Jenny Pedler
Advertisements

Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
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.
VBA Modules, Functions, Variables, and Constants
Using Visual Basic 6.0 to Create Web-Based Database Applications
Introduction to VBA Programming. Many Types of Statements VBA statements Access object model’s methods and properties Data Access Object’s methods and.
CVEV 118/698 Visual Basic Lecture 1 Prof. Mounir Mabsout Expert 1: Elsa Sulukdjian Expert 2: Walid El Asmar.
Using Objects and Properties
VBA Programming Session #2. Things to Review  Variables  Procedures: Subs & Functions  If…Then  For…Next.
Slide 1 Variables, Constants and Data Types. Slide 2 Variables v Three components define a variable: –Name (memory location) –Type –Information (value)
Chapter 41 Sub Procedures, Part II (Continue). Chapter 42 Local Variable A variable declared inside a Sub procedure with a Dim statement Space reserved.
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.
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 3 Variables, Constants,
Scope of Variables and Constants A Variable or Constant may exist and be Visible for an entire project, for only one form, or for only one procedure Therefore,
VB – Core III Functions Sub-routines Parameter passing Modules Scope Lifetime.
VBA & Excel Barry L. Nelson IEMS 465 Fall Quarter 2003.
© 1999, by Que Education and Training, Chapter 11, pages of Introduction to Computer Programming with Visual Basic 6: A Problem-Solving Approach.
Private Sub Close_Click() On Error GoTo Err_Close_Click DoCmd.Close Exit_Close_Click: Exit Sub Err_Close_Click: MsgBox Err.Description Resume Exit_Close_Click.
Chapter 3 Programming Fundamentals Writing Code 3 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
Using Visual Basic 6.0 to Create Web-Based Database Applications
National Diploma Unit 4 Introduction to Software Development Data types, variables and constants.
Lecture 8 Visual Basic (2).
Access VBA Programming for Beginners - Class 2 - by Patrick Lasu
Types and Loops.
Introduction to ADO Y.-H. Chen International College Ming-Chuan University Fall, 2004.
Visual Basic CODE. Basics of Code Declaration Declaration Set aside a named place to put things Set aside a named place to put things Assignment Assignment.
Dani Vainstein1 VBScript Session 1. Dani Vainstein2 Subjets for Session 1 Vbscript fundamentals. Variant subtypes. Variables. Option Explicit statement.
MS Visual Basic Applications Walter Milner. Event-driven programming Standard approach for GUIs Contrast with old character interfaces – program determines.
Variables,Constants and Data types Variables temporarily stores values during the execution of an application Variables have a name and data type Declare.
Visual Basic.net Loops. Used to do multiple executions of the same block of code Do while loops Do until loops For next loops.
24/01/2011 harshana-fernando.blogspot.com 1 Introduction to Procedures Modules A module is a file that holds code or pieces of code in a Visual Basic application.
COMPUTER PROGRAMMING II SUMMER 2011 Visual Basic to C#
Overview of VBA Programming & Syntax. Programming With Objects u Objects –Properties: attributes or characteristics of an object (e.g., font size, color,
‘Tirgul’ # 2 Enterprise Development Using Visual Basic 6.0 Autumn 2002 Tirgul #2.
Chapter 3 w Variables, constants, and calculations DIM statements - declaration temporary memory locations identifier, data type, scope data types - values.
Other Variable Types Dim lab as String makes a box that can store a label tag Dim ColHead As String ColHead = “function” ColHead function Dim lab as Boolean.
Visual Basic Programming I 56:150 Information System Design.
Lab 8 Data Access Using Microsoft ActiveX Data Object (ADO)
Objects in Access zGeneral Access objects zData access objects (DAO) yused for data management xdata definition xdata manipulation yused only in code modules.
Programming with Microsoft Visual Basic th Edition
Created by Alia Al-Abdulkarim 2008 Visual Basic Vs. Java.
CIVIL AND GEOMATIC ENGINEERING FT Okyere. CIV 257- COMPUTER PROGRAMMING Lecture 3.
Variables Hold information that may be manipulated, used to manipulate other information or remembered for later use A storage location in memory (RAM)
Variables in VB.NET. Variables  A storage location in memory (RAM)  Holds data/information while the program is running  These storage locations can.
1 Microsoft® Visual Basic®.NET Language # 2. 2 Flow-Control Statements If … End If Select Case … End Select For… Next Do … Loop Exit.
Understanding Visual Basic Fundamentals CHAPTER 13 Understanding Visual Basic Fundamentals.
Visual Basic Review LBS 126. VB programming Project Form 1Form 2Form 3 Text boxButton Picture box Objects Text box Button Objects.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
More on Variables and Subroutines. Introduction Discussion so far has dealt with self- contained subs. Subs can call other subs or functions. A module.
Mark Dixon 1 Soft051 Examination Sample Questions.
CSC 162 Visual Basic I Programming. Storage Classes Determines the “lifetime” of an identifier Types: –Automatic Default Memory is allocated for the variable.
OCR AS Level F452: Data types and data structures Data types and data structures a. define different data types, eg numeric (integer, real),
1 By Dr. HANY ELSALAMONY. 1. What are differences between interpreted and compiled languages? 2. What are the programming steps to creating the Visual.
Visual Basic 6.0 Final Review
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
Introduction to VBA Programming
Visual Basic 6 Programming.
CS285 Introduction - Visual Basic
Chapter 7: Using Functions, Subs, and Modules
Data Types List Box Combo Box Checkbox Option Box Visual Basic 6.0
Excel – VBA TypeMismatch (Error 13) on OpenRecordset Method Call
Intro to Programming Concepts
The structure of programming
GCSE Computing:: Selection (IF statements)
Visual Basic Numbers Chapter 3.3 Prepared By: Deborah 7/9/2019.
Presentation transcript:

Microsoft Access Using Visual Basic Routines

Visual Basic Datatypes Boolean Byte Currency Date Double Integer Long Object Single String Variant Hyperlink

Variables and Arrays Use of “Dim” e.g. Dim count as Integer Use of “Dim” to create arrays e.g. Dim intArray(1 To 10) as Integer

Initializations intVariable = 10 stringVariable = “Hello, world.” dateVariable = #02/02/2001#

Variable Scope and Lifetime PUBLIC: seen by all the procedures in that module PRIVATE: can be referenced from within the module in which it is declared

Selection Structures If Then statement1 statement2 Else statement3 statement4 End If

Selection Structures Select Case Case statements… Case statements… Case Else statements... End Select

Loops For = To statement 1... statement2... Next

Loops (contd…) Do Until statement 1... statement 2... Loop

Procedures Sub ( ) … Code for the procedure … End Sub

Data Objects DAO = Data Access Object RDO = Remote Data Object RDS = Remote Data Services ADO = ActiveX Data Object

Useful DAOs DAO = Data Access Object Database RecordSet

Database DAO Refers to the database open in the current workspace. Only one database per workspace. E.g. –Dim db as Database –Set db = CurrentDb

Recordset DAO There exists one Recordset object for every recordset currently open. A Recordset is the result of the execution of a query. E.g. Dim rs as Recordset Set rs = db.OpenRecordSet(“Login”)