d2vbaref.doc Page 1 of 22 05/11/02 14:21

Size: px
Start display at page:

Download "d2vbaref.doc Page 1 of 22 05/11/02 14:21"

Transcription

1 Database Design 2 1. VBA or Macros? Advantages of VBA: When to use macros From here A simple event procedure The code explained How does the error handling work? Procedures Modules Class Modules Standard Modules The Declarations Section Variables Declaring variables Variable Scope and lifetime Data types Variants Using the Option Explicit Statement Sub Statement Function Statement Events Event Procedures Responding to a click event by using an Event Procedure Writing Code Adding comments and continuing a statement over multiple lines Checking Syntax Errors Declaration Statements Assignment Statements Executable Statements Compiling Code d2vbaref.doc Page 1 of 22 05/11/02 14:21

2 1. VBA or Macros? You can use either macros or VBA to automate your database. Macros are easier to learn to use and work well for simple tasks but VBA, the programming language supplied with Access, is more powerful and flexible. You need to learn to use VBA if you want to produce applications to a professional standard. 1.1 Advantages of VBA: Easier maintenance The program code used with a form or report is part of that form or report. This means that if forms or reports are moved or copied to another database the code automatically goes with them. Macros are separate objects and need to be moved as well for the form or report to work correctly. Create your own functions. You can create your own functions either to perform calculations that exceed the capability of an expression or to replace complex expressions. In addition, you can use the functions you create in expressions to apply a common operation to more than one object. More flexible VBA gives you much more programmatic control. Code can run in response to user input and a wider selection of actions and arguments are available. Executes faster Long, complex macros will execute considerably more slowly than the equivalent actions in VBA. Easier to read and print You can only see one set of action arguments at a time in the macro window. This means you have to click on each action in turn to see all the details of the macro. In the VBA code window all the code is visible at the same time so it is much easier to read or print. Mask error messages. If an unexpected error happens while a database is being used, the message displayed can often been confusing to the user. Using VBA, you can detect, trap and handle errors as they occur. By displaying an appropriate message, or writing code that takes an action, the user need not be aware that an error has taken place. Create or manipulate objects. In most cases, you'll find that it's easiest to create and modify an object in that object's Design view. In some situations, however, you may want to manipulate the definition of an object in code. Using VBA, you can manipulate all the objects in a database, as well as the database itself. Perform system-level actions. Using VBA, you can check to see if a file exists on the system, use Automation or dynamic data exchange (DDE) to communicate with other Windows-based applications such as Microsoft Excel, and call functions in Windows dynamic-link libraries (DLLs). Manipulate records one at a time. You can use VBA to step through a set of records one record at a time and perform an operation on each record. In contrast, macros work with entire sets of records at once. Pass arguments to your VBA procedures. You can pass arguments to your code at the time it is run or you can use variables for arguments - something you can't do in macros. This gives you a great deal of flexibility in how your Visual Basic procedures run. d2vbaref.doc Page 2 of 22 05/11/02 14:21

3 Integration with other Office applications You can use VBA to integrate your database with other applications such as Word and Excel. 1.2 When to use macros Prototyping Macros are ideal as a prototype tool. They are an easy way to take care of simple details such as opening and closing forms, showing and hiding toolbars, and running reports. You can quickly and easily tie together the database objects you've created because there's little syntax to remember; the arguments for each action are displayed in the lower part of the Macro window. Simple actions required to occur on a particular event, such as clicking on a command button, or a combo box, can be quickly and easily set-up If you want actions to run whenever the database is opened you need to use the AutoExec macro. However much of the functionality of this has now been replaced by the Startup options (Tools menu). If you want VBA code to run when the database opens you can use the RunCode action in the Autoexec macro. 1.3 From here... So you're convinced! You have to learn VBA. The following sections take you through some of the basics such as:. How does VBA code actually work? (See Section 2) What exactly is a procedure? (See Section 3) Where is the code stored and what is the difference between a Class module and a standard module? See Section 4 What are variables and how do you use them? See (Section 5) How do you write code? (See Section 9) d2vbaref.doc Page 3 of 22 05/11/02 14:21

4 2. A simple event procedure The following procedure is a typical piece of code that allows a user to create a new record. It is activated when a command button is pressed on an Access form. Private Sub Add_Click() On Error GoTo Err_Add_Click DoCmd.GoToRecord,, acnewrec Exit_Add_Click: Exit Sub Err_Add_Click: MsgBox Err.Description Resume Exit_Add_Click End Sub 2.1 The code explained The Private Sub and End Sub lines designate the beginning and end of the procedure. Add_click() is the name of the procedure. Note that it is followed by parentheses (brackets). Any arguments (see below) passed to the procedure would be inserted here. In the case of a procedure that doesn't take any arguments, as this example, the parentheses will be empty. The name will be used to call the procedure. In between these two lines is the body of the procedure. This contains the instructions that are executed when the procedure is run. The majority of code in this procedure relates to error handling. If there is not an error only the highlighted lines of code will execute. The main action of this procedure is carried out by the line: DoCmd.GoToRecord,, AcNewrec This tells Access to move to a new record. In order to understand how this line of code works, it is probably easiest to take it apart piece by piece. Keyword : Each word that Access recognises as part of the VBA language is called a keyword (sometimes also known as a reserved word). These words have special meanings in VBA and you cannot be used for any other purpose (e.g naming variables see...). Object: The first keyword in the line is DoCmd. DoCmd is an object. An object is something that knows how to perform actions. The DoCmd object knows how to perform common actions such as opening a form, printing a report or choosing a menu command. You'll be using the DoCmd object a lot when you start to program with VBA. Method: The second keyword is GoToRecord, which is a method of the DoCmd object. Methods are the actions that an object knows how to perform and each object has its own set of methods. The methods of the DoCmd object are all the actions it knows how to perform - if you've used macros you'll quickly notice that these are identical to the macro actions available in the Macro window. For example, the GoToRecord method has the action of telling Access to move to a specified record. Arguments: Following the GoToRecord method are its arguments. The arguments provide any information required to carry out the method. For example, when you use the GoToRecord method you need to specify which record to move to. The argument list is separated from the method by a space, with a comma (,) between each argument in the list. d2vbaref.doc Page 4 of 22 05/11/02 14:21

5 Each method has a specified number of arguments, some of which are optional (you don't necessarily need to enter them). You must type the commas to indicate that optional arguments have been omitted unless they come at the end of the list. GoToRecord method takes four arguments: object type (e.g. form)* object name (e.g. frmemployees)* which the record to move to. This is specified as a constant (see below). the offset (distance from the current record)* * omitted in this example. Constant Values: Some methods, such as GoToRecord, have specially defined constant values (constants) that you can enter as arguments. Constants represent numbers, which is the type of argument the method expects in this position, but a name is much easier to remember and makes code more understandable. acnewrec is a constant with the value 5 that tells the GoToRecord Method to move to the new record at the end of the recordset. Other constants that can be used with the GoToRecord method are: acprevious acnext acfirst aclast acgoto You should be able to work out what you'd expect each of these to do. acgoto instructs the method to move to a particular record but which record? If you use this argument you also need to use the fourth argument (offset) to specify the number of the record to move to. If you omit the fourth argument for acprevious the method will move back one record but you can use it to specify a particular number of records. acnext works in a similar way but moves forward. The offset argument is not applicable to the other constants. Now you should be able to see that in this line the first two arguments have been omitted meaning that the method will operate on the current object. The fourth argument has also been omitted but we don't need to indicate this with a comma as it is the last argument in the list. The third argument tells the method to move to the new record at the end of the recordset. DoCmd.GoToRecord,, AcNewrec Once this line of code has been executed the procedure moves on to the next highlighted line of code: Exit Sub This has the effect of ignoring all the following lines of code and exiting from the procedure. 2.2 How does the error handling work? The first line of code On Error GoTo Err_Add_Click tells the procedure what to do if there's an error. It instructs it to move to the section labelled Err_Add_Click: Notice that this line ends with a colon (:) meaning that it is a label rather than an instruction to be carried out. The procedure moves to this point in the code and then executes the following two instructions. MsgBox Err.Description displays a message describing the error on the screen. Resume Exit_Add_Click moves back to the line labelled Exit_Add_Click: which conveniently takes us back to the Exit Sub line so the procedure ends. d2vbaref.doc Page 5 of 22 05/11/02 14:21

6 3. Procedures A procedure is a unit of Visual Basic for Applications code. A procedure contains a series of statements and methods that perform an operation or calculate a value. For example, the following event procedure uses the OpenForm method to open the form: Private Sub OpenOrders_Click() End Sub DoCmd.OpenForm "Orders" There are two kinds of procedures: Sub procedures perform an operation or series of operations but don't return a value. You can create your own Sub procedures or use the Access event procedure templates that are created for you. Function procedures (often simply called functions) return a value, such as the result of a calculation. Visual Basic includes many built-in functions; for example, the Now() function returns the current date and time. In addition to these built-in functions, you can create your own custom functions. Because functions return values, you can use them in expressions. You can use functions in expressions in many places in Access, including a VBA statement or method, in many property settings, or in a criteria expression in a filter or query. Here is an example of a Function procedure, FirstOfNextMonth, that returns the date of the first day of the month following the current date: Function FirstOfNextMonth() FirstOfNextMonth =DateSerial(Year(Now), Month(Now) + 1, 1) End Function This custom function consists of a single assignment statement that assigns the results of an expression (on the right side of the equal sign [=]) to the name of the function, FirstOfNextMonth (on the left side of the equal sign). The function calculates a result using the built-in Visual Basic DateSerial, Year, Now, and Month functions. Once you create this function, you can use it in an expression almost anywhere in Microsoft Access. For example, you could specify that a text box display the first day of the month following the current date as its default value by setting the text box control's DefaultValue property to the following expression in the property sheet: =FirstOfNextMonth() d2vbaref.doc Page 6 of 22 05/11/02 14:21

7 Both Sub and Function procedures can accept arguments. Function is a procedure, which accepts none or several arguments and returns a value, which can be used in an expression (Example: NoDays(month) 'returns number of days in a given month) Sub is a procedure, which accepts none, or several arguments but which cannot be used in any expression. All executable code must be in Sub or Function procedures. You can't define a Sub procedure inside another Sub or Function procedure. More about Sub procedures (Section 6) More about Function procedures (Section 7) d2vbaref.doc Page 7 of 22 05/11/02 14:21

8 4. Modules All VBA code is stored in Modules. There are two types: Class Modules contain code that is associated with a particular form or report and the code in them can only be run from that form or report. Standard Modules contain general purpose procedures that can be run from anywhere within your database. Procedures in your form and report modules can call procedures you have added to standard modules. 4.1 Class Modules Form and report modules are class modules that are associated with a particular form or report. They often contain event procedures that run in response to an event on the form or report. You can use event procedures to control the behaviour of your forms and reports, and their response to user actions such as clicking the mouse on a command button. When you create the first event procedure for a form or report, Microsoft Access automatically creates an associated form or report module. To see the module for a form or report, change to Design view and click the Code button Menu. on the toolbar or Select Code from the View Hint: You can also use ALT + F11 to switch between the database and code windows. List of objects that have modules associated with them Procedures stored in module of selected object 4.2 Standard Modules Standard modules contain general procedures that aren't associated with any particular object. They are useful for frequently used procedures that can be run from anywhere within your database. To view the list of standard modules in your database click the Modules Object in the Database window. You can open an existing module to view, modify or add to the code by clicking the Design button on the toolbar. To create a new module, click the New button. This opens the Code window with a new module window for you to enter code into. d2vbaref.doc Page 8 of 22 05/11/02 14:21

9 Code for existing module List of Standard Modules in your database Window to enter code for new module 4.3 The Declarations Section The Declarations section contains the Option Compare Database statement, and can also contain other statements. The declarations section is the topmost level of a module that appears before any Sub or Function procedures. This section contains definitions of userdefined data types, global constants, and global variables. To display the Declarations section, select (declarations) in the Procedure box in the Module window: d2vbaref.doc Page 9 of 22 05/11/02 14:21

10 5. Variables A variable is a named storage location that can contain data that can be modified during program execution. Each variable has a name that uniquely identifies it within its level of scope. A data type can be specified or not. You can refer to data and objects directly in your code, or declare object variables to represent them. Once an object variable is declared and assigned, you can use it just as you would the name of the object it represents, and you can change its value, just as you can change the value of any variable. 5.1 Declaring variables When declaring variables you usually use the Dim <variable name> statement. For example: Dim dbs As Database, tbl As TableDef, fld As Field The statement above declares three variables, a Database object named dbs, a TableDef object named tbl and a Field object named fld. Rules for Variable Names Must start with a letter. Can only contain letters, numbers and underscores ([Shift]+[-]). Cannot be longer than 40 characters. Cannot be reserved words. Avoid using spaces in variable names because most other DBMS systems will not accept names with spaces. 5.2 Variable Scope and lifetime The scope of a variable refers to its visibility, that is, where it can be seen. The value of a variable can only be changed when it is in scope. A variable that is declared within a procedure has local scope. Its value can only be referred to or changed from within that procedure. Variables can also be declared the Declarations section at the top of a module. These module-level variables can be seen and used by all procedures in that module and are said to have public scope. The lifetime of a variable means how long it can be seen for, or how long it is in scope. Local variables only exist while their procedure is running. Once the procedure finishes their value is lost. The next time that the procedure is called the local variables are recreated. To create a variable that retains its value between procedure calls you must declare it as Static as in the following statement: Static intnum As Integer A variable declared in this way is only in scope when the procedure in which it is declared is running but it retains its value between calls to the procedure. This can be useful if, for example, you want to increment a counter each time a procedure is called. Module-level variables are available to all procedures within the module, but not to procedures in other modules in the project. To make them available to all procedures in the project, they must be declared as Public, as in the following statement: d2vbaref.doc Page 10 of 22 05/11/02 14:21

11 Public strname As String A variable declared in this way exists as long as the database is open and can be used by all procedures in the database. 5.3 Data types Variables can be declared as one of the following data types: Boolean Double Byte Date Integer String (for variable-length strings) Long String * length (for fixed-length strings Currency Object Single Variant If you do not specify a data type, the Variant data type is assigned by default. You can also create a user-defined type using the Type statement. 5.4 Variants The Variant data type is automatically specified if you don't specify a data type when you declare a constant, variable, or argument. Variables declared as the Variant data type can contain string, date, time, Boolean, or numeric values, and can convert the values they contain automatically. Numeric Variant values require 16 bytes of memory (which is significant only in large procedures or complex modules) and they are slower to access than explicitly typed variables of any other type. You rarely use the Variant data type for a constant. String Variant values require 22 bytes of memory. The following statements create Variant variables: Dim myvar Dim yourvar As Variant thevar = "This is some text." The last statement does not explicitly declare the variable thevar, but rather declares the variable implicitly, or automatically. Variables that are declared implicitly are specified as the Variant data type. 5.5 Using the Option Explicit Statement You can implicitly declare a variable in Visual Basic simply by using it in an assignment statement. All variables that are implicitly declared are of type Variant. Variables of type Variant require more memory resources than most other variables. Your application will be d2vbaref.doc Page 11 of 22 05/11/02 14:21

12 more efficient if you declare variables explicitly and with a specific data type. Explicitly declaring all variables reduces the incidence of naming-conflict errors and spelling mistakes. If you don't want Visual Basic to make implicit declarations, you can place the Option Explicit statement in a module before any procedures. This statement requires you to explicitly declare all variables within the module. If a module includes the Option Explicit statement, a compile-time error will occur when Visual Basic encounters a variable name that has not been previously declared, or that has been spelled incorrectly. This example uses the Option Explicit statement to force you to explicitly declare all variables. Attempting to use an undeclared variable causes an error at compile time. The Option Explicit statement is used at the module level only. Option explicit ' Force explicit variable declaration. Dim MyVar ' Declare variable. MyInt = 10 ' Undeclared variable generates error. MyVar = 10 ' Declared variable does not generate error. d2vbaref.doc Page 12 of 22 05/11/02 14:21

13 6. Sub Statement The sub statement declares the name, arguments, and code that form the body of a Sub procedure. The Sub statement syntax has these parts: Public Part Description Optional. Indicates that the Sub procedure is accessible to all other procedures in all modules. If used in a module that contains an Option Private statement, the procedure is not available outside the project. Private Optional. Indicates that the Sub procedure is accessible only to other procedures in the module where it is declared. Static Optional. Indicates that the Sub procedure's local variables are preserved between calls. The Static attribute doesn't affect variables that are declared outside the Sub, even if they are used in the procedure. name Required. Name of the Sub; follows standard variable naming conventions. arglist Optional. List of variables representing arguments that are passed to the Sub procedure when it is called. Multiple variables are separated by commas. d2vbaref.doc Page 13 of 22 05/11/02 14:21

14 statements Optional. Any group of statements to be executed within the Sub procedure. d2vbaref.doc Page 14 of 22 05/11/02 14:21

15 7. Function Statement The function statement declares the name, arguments, and code that form the body of a Function procedure. The Function statement syntax has these parts: Part Public Description Optional. Indicates that the Function procedure is accessible to all other procedures in all modules. If used in a module that contains an Option Private, the procedure is not available outside the project. Private Optional. Indicates that the Function procedure is accessible only to other procedures in the module where it is declared. Static Optional. Indicates that the Function procedure's local variables are preserved between calls. The Static attribute doesn't affect variables that are declared outside the Function, even if they are used in the procedure. name Required. Name of the Function; follows standard variable naming conventions. arglist Optional. List of variables representing arguments that are passed to the Function procedure when it is called. Multiple variables are separated by commas. type Optional. Data type of the value returned by the Function procedure; may be Byte, Boolean, Integer, Long, Currency, Single, Double, Decimal (not currently supported), Date, String, or (except fixed length), Object, Variant or any user defined type Arrays of any type can't be returned d2vbaref.doc Page 15 of 22 05/11/02 14:21

16 but a Variant containing an array can. statements Optional. Any group of statements to be executed within the Function procedure. expression Optional. Return value of the Function. d2vbaref.doc Page 16 of 22 05/11/02 14:21

17 8. Events An event is a specific action that occurs on or with a certain object. Microsoft Access can respond to a variety of events: mouse clicks, changes in data, forms opening or closing, and many others. Events are usually the result of user action. Using either an event procedure or a macro, you can add your own custom response to an event that occurs on a form, report, or control. 8.1 Event Procedures The Code Builder displays the Module window, in which you create or modify an event procedure from within an event property of a form, report, section, or control. An event procedure is a Sub procedure which is invoked automatically in response to an event. To create an event procedure, you must first determine the event (for example, a mouse click or updating a record) whose event property will trigger the event procedure. Event procedures are stored with the form or report module they were created in. 8.2 Responding to a click event by using an Event Procedure When you create an event procedure for an object, Microsoft Access adds an event procedure template named for the event and the object to the form or report module. All you need to do is add code that responds in the way you want when the event occurs for the form or report. d2vbaref.doc Page17 of 22 05/11/02 14:21

18 9. Writing Code A statement in Visual Basic is a complete instruction. It can contain: Keywords Operators Variables Constants Expressions. Each statement belongs to one of the following three categories: Declaration statements, which name a variable, constant, or procedure and can also specify a data type. Assignment statements, which assign a value or expression to a variable or constant. Executable statements, which initiate actions. These statements can execute a method or function, and they can loop or branch through blocks of code. Executable statements often contain mathematical or conditional operators. 9.1 Adding comments and continuing a statement over multiple lines Comments can explain a procedure or a particular instruction to anyone reading your code. Comment lines begin with an apostrophe (') or with Rem followed by a space, and can be added anywhere in a procedure. By default, comments are displayed as green text. A long statement can be continued onto the next line using a line-continuation character ( _ ) Sub TestBox() 'This procedure declares a string variable, assigns it the value John, and then displays a message. End Sub Dim myvar As String myvar = "John" MsgBox Prompt:="Hello " & myvar, Title:="Greeting Box", _ Buttons:=vbExclamation 9.2 Checking Syntax Errors If you press ENTER after typing a line of code and the line is displayed in red (an error message may display as well), you must find out what's wrong with your statement, and then correct it. Extra Information - Writing Code Declaration Statements d2vbaref.doc Page18 of 22 05/11/02 14:21

19 You use declaration statements to name and define procedures, variables, arrays, and constants. When you declare a procedure, variable, or constant, you also define its scope, depending on where you place the declaration and what keywords you use to declare it. The following example contains three declarations. Sub ApplyFormat() Const limit As Integer = 33 Dim mycell As Range ' More statements End Sub The Sub statement (with matching End Sub statement) declares a procedure named ApplyFormat. All the statements enclosed by the Sub and End Sub statements are executed whenever the ApplyFormat procedure is called or run. The Const statement declares the constant limit, specifying the Integer data type and a value of 33. The Dim statement declares the variable mycell. The data type is an object, in this case, a Microsoft Excel Range object. You can declare a variable to be any object that is exposed in the application you are using. Dim statements are one type of statement used to declare variables. Other keywords used in declarations are ReDim, Static, Public, Private, and Const. Assignment Statements Assignment statements assign a value or expression to a variable or constant. Assignment statements always include an equal sign (=). The following example assigns the return value of the InputBox function to the variable yourname. Sub Question() Dim yourname As String yourname = InputBox("What is your Name?") MsgBox "Your name is " & yourname End Sub The Let statement is optional and is usually omitted. For example, the preceding assignment statement can be written Let yourname = InputBox("What is your name?"). The Set statement is used to assign an object to a variable that has been declared as an object. The Set keyword is required. In the following example, the Set statement assigns a range on Sheet1 to the object variable mycell: Sub ApplyFormat() d2vbaref.doc Page19 of 22 05/11/02 14:21

20 End Sub Dim mycell As Range Set mycell = Worksheets("Sheet1").Range("A1") With mycell.font.bold = True.Italic = True End With Statements that set property values are also assignment statements. The following example sets the Bold property of the Font object for the active cell: Executable Statements ActiveCell.Font.Bold = True An executable statement initiates action. It can execute a method or function, and it can loop or branch through blocks of code. Executable statements often contain mathematical or conditional operators. The following example uses a For Each...Next statement to iterate through each cell in a range named MyRange on Sheet1 of an active Microsoft Excel workbook. The variable c is a cell in the collection of cells contained in MyRange. Sub ApplyFormat() End Sub Const limit As Integer = 33 For Each c In Worksheets("Sheet1").Range("MyRange").Cells If c.value > limit Then With c.font.bold = True.Italic = True End With End If Next c MsgBox "All done!" d2vbaref.doc Page20 of 22 05/11/02 14:21

21 The If...Then...Else statement in the example checks the value of the cell. If the value is greater than 33, the With statement sets the Bold and Italic properties of the Font object for that cell. If...Then...Else statements end with End If. The With statement can save typing because the statements it contains are automatically executed on the object following the With keyword. The Next statement calls the next cell in the collection of cells contained in MyRange. The MsgBox function (which displays a built-in Visual Basic dialog box) displays a message indicating that the Sub procedure has finished running. d2vbaref.doc Page21 of 22 05/11/02 14:21

22 10. Compiling Code As you create your procedures, you will notice how Access checks each line of code you enter to make sure that it doesn't contain any errors. However, many errors are not obvious in a single line. To see them, you have to look at the line of code in the context of the rest of the procedure or application. Although it does not do so automatically while you enter code, Access does check your procedures before you run them. It checks for various types of consistency (e.g. whether the variables you have used in your code are all declared, and whether the procedures you call exist in your application). This process is called compiling. One way to compile a procedure is to try running it. But this is not a very efficient method to use and you can therefore ask Access to compile your procedures at any time. To do this you select Compile from the Debug menu. d2vbaref.doc Page22 of 22 05/11/02 14:21

Lab 7 Macros, Modules, Data Access Pages and Internet Summary Macros: How to Create and Run Modules vs. Macros 1. Jumping to Internet

Lab 7 Macros, Modules, Data Access Pages and Internet Summary Macros: How to Create and Run Modules vs. Macros 1. Jumping to Internet Lab 7 Macros, Modules, Data Access Pages and Internet Summary Macros: How to Create and Run Modules vs. Macros 1. Jumping to Internet 1. Macros 1.1 What is a macro? A macro is a set of one or more actions

More information

EnableBasic. The Enable Basic language. Modified by Admin on Sep 13, Parent page: Scripting Languages

EnableBasic. The Enable Basic language. Modified by Admin on Sep 13, Parent page: Scripting Languages EnableBasic Old Content - visit altium.com/documentation Modified by Admin on Sep 13, 2017 Parent page: Scripting Languages This Enable Basic Reference provides an overview of the structure of scripts

More information

Language Fundamentals

Language Fundamentals Language Fundamentals VBA Concepts Sept. 2013 CEE 3804 Faculty Language Fundamentals 1. Statements 2. Data Types 3. Variables and Constants 4. Functions 5. Subroutines Data Types 1. Numeric Integer Long

More information

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6)

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6) Technology & Information Management Instructor: Michael Kremer, Ph.D. Database Program: Microsoft Access Series DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6) AGENDA 3. Executing VBA

More information

variables programming statements

variables programming statements 1 VB PROGRAMMERS GUIDE LESSON 1 File: VbGuideL1.doc Date Started: May 24, 2002 Last Update: Dec 27, 2002 ISBN: 0-9730824-9-6 Version: 0.0 INTRODUCTION TO VB PROGRAMMING VB stands for Visual Basic. Visual

More information

VBA Excel 2013/2016. VBA Visual Basic for Applications. Learner Guide

VBA Excel 2013/2016. VBA Visual Basic for Applications. Learner Guide VBA Visual Basic for Applications Learner Guide 1 Table of Contents SECTION 1 WORKING WITH MACROS...5 WORKING WITH MACROS...6 About Excel macros...6 Opening Excel (using Windows 7 or 10)...6 Recognizing

More information

Excel VBA Variables, Data Types & Constant

Excel VBA Variables, Data Types & Constant Excel VBA Variables, Data Types & Constant Variables are used in almost all computer program and VBA is no different. It's a good practice to declare a variable at the beginning of the procedure. It is

More information

Vba Variables Constant and Data types in Excel

Vba Variables Constant and Data types in Excel Vba Variables Constant and Data types in Excel VARIABLES In Excel VBA, variables are areas allocated by the computer memory to hold data. Data stored inside the computer memory has 4 properties: names,

More information

Copyright. Trademarks Attachmate Corporation. All rights reserved. USA Patents Pending. WRQ ReflectionVisual Basic User Guide

Copyright. Trademarks Attachmate Corporation. All rights reserved. USA Patents Pending. WRQ ReflectionVisual Basic User Guide PROGRAMMING WITH REFLECTION: VISUAL BASIC USER GUIDE WINDOWS XP WINDOWS 2000 WINDOWS SERVER 2003 WINDOWS 2000 SERVER WINDOWS TERMINAL SERVER CITRIX METAFRAME CITRIX METRAFRAME XP ENGLISH Copyright 1994-2006

More information

VBA Collections A Group of Similar Objects that Share Common Properties, Methods and

VBA Collections A Group of Similar Objects that Share Common Properties, Methods and VBA AND MACROS VBA is a major division of the stand-alone Visual Basic programming language. It is integrated into Microsoft Office applications. It is the macro language of Microsoft Office Suite. Previously

More information

MS Excel VBA Class Goals

MS Excel VBA Class Goals MS Excel VBA 2013 Class Overview: Microsoft excel VBA training course is for those responsible for very large and variable amounts of data, or teams, who want to learn how to program features and functions

More information

Avoiding Naming Conflicts

Avoiding Naming Conflicts Avoiding Naming Conflicts A naming conflict occurs when you try to create or use an identifier that was previously defined. In some cases, naming conflicts generate errors such as "Ambiguous name detected"

More information

Microsoft Visual Basic 2005: Reloaded

Microsoft Visual Basic 2005: Reloaded Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations Objectives After studying this chapter, you should be able to: Declare variables and named

More information

Cpt S 122 Data Structures. Introduction to C++ Part II

Cpt S 122 Data Structures. Introduction to C++ Part II Cpt S 122 Data Structures Introduction to C++ Part II Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Topics Objectives Defining class with a member function

More information

Civil Engineering Computation

Civil Engineering Computation Civil Engineering Computation First Steps in VBA Homework Evaluation 2 1 Homework Evaluation 3 Based on this rubric, you may resubmit Homework 1 and Homework 2 (along with today s homework) by next Monday

More information

You can record macros to automate tedious

You can record macros to automate tedious Introduction to Macros You can record macros to automate tedious and repetitive tasks in Excel without writing programming code directly. Macros are efficiency tools that enable you to perform repetitive

More information

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 10/e Education, Inc. All Rights Reserved. Each class you create becomes a new type that can be used to declare variables and create objects. You can declare new classes as needed;

More information

SKILL AREA 306: DEVELOP AND IMPLEMENT COMPUTER PROGRAMS

SKILL AREA 306: DEVELOP AND IMPLEMENT COMPUTER PROGRAMS Add your company slogan SKILL AREA 306: DEVELOP AND IMPLEMENT COMPUTER PROGRAMS Computer Programming (YPG) LOGO 306.1 Review Selected Programming Environment 306.1.1 Explain the concept of reserve words,

More information

Visual Basic.NET. 1. Which language is not a true object-oriented programming language?

Visual Basic.NET. 1. Which language is not a true object-oriented programming language? Visual Basic.NET Objective Type Questions 1. Which language is not a true object-oriented programming language? a.) VB.NET b.) VB 6 c.) C++ d.) Java Answer: b 2. A GUI: a.) uses buttons, menus, and icons.

More information

Sébastien Mathier wwwexcel-pratiquecom/en Variables : Variables make it possible to store all sorts of information Here's the first example : 'Display the value of the variable in a dialog box 'Declaring

More information

20. VB Programming Fundamentals Variables and Procedures

20. VB Programming Fundamentals Variables and Procedures 20. VB Programming Fundamentals Variables and Procedures 20.1 Variables and Constants VB, like other programming languages, uses variables for storing values. Variables have a name and a data type. Array

More information

VARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs.

VARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. Lesson 2 VARIABLES Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. WHAT ARE VARIABLES? When you input data (i.e. information) into a computer

More information

OpenOffice.org 3.2 BASIC Guide

OpenOffice.org 3.2 BASIC Guide OpenOffice.org 3.2 BASIC Guide Copyright The contents of this document are subject to the Public Documentation License. You may only use this document if you comply with the terms of the license. See:

More information

COIMBATORE EDUCATIONAL DISTRICT

COIMBATORE EDUCATIONAL DISTRICT COIMBATORE EDUCATIONAL DISTRICT REVISION EXAMINATION JANUARY 2015 STD-12 COMPUTER SCIENCE ANSEWR KEY PART-I Choose the Correct Answer QNo Answer QNo Answer 1 B Absolute Cell Addressing 39 C Void 2 D

More information

CS130/230 Lecture 12 Advanced Forms and Visual Basic for Applications

CS130/230 Lecture 12 Advanced Forms and Visual Basic for Applications CS130/230 Lecture 12 Advanced Forms and Visual Basic for Applications Friday, January 23, 2004 We are going to continue using the vending machine example to illustrate some more of Access properties. Advanced

More information

Lesson 1: Writing Your First JavaScript

Lesson 1: Writing Your First JavaScript JavaScript 101 1-1 Lesson 1: Writing Your First JavaScript OBJECTIVES: In this lesson you will be taught how to Use the tag Insert JavaScript code in a Web page Hide your JavaScript

More information

This chapter is intended to take you through the basic steps of using the Visual Basic

This chapter is intended to take you through the basic steps of using the Visual Basic CHAPTER 1 The Basics This chapter is intended to take you through the basic steps of using the Visual Basic Editor window and writing a simple piece of VBA code. It will show you how to use the Visual

More information

Programming Language 2 (PL2)

Programming Language 2 (PL2) Programming Language 2 (PL2) 337.1.1 - Explain rules for constructing various variable types of language 337.1.2 Identify the use of arithmetical and logical operators 337.1.3 Explain the rules of language

More information

Getting started 7. Writing macros 23

Getting started 7. Writing macros 23 Contents 1 2 3 Getting started 7 Introducing Excel VBA 8 Recording a macro 10 Viewing macro code 12 Testing a macro 14 Editing macro code 15 Referencing relatives 16 Saving macros 18 Trusting macros 20

More information

Customizing Access Parameter Queries

Customizing Access Parameter Queries [Revised and Updated 15 August 2018] Everyone likes parameter queries! The database developer doesn't have to anticipate the user's every requirement, and the user can vary their enquiries without having

More information

EXCEL 2003 DISCLAIMER:

EXCEL 2003 DISCLAIMER: EXCEL 2003 DISCLAIMER: This reference guide is meant for experienced Microsoft Excel users. It provides a list of quick tips and shortcuts for familiar features. This guide does NOT replace training or

More information

Procedures in Visual Basic

Procedures in Visual Basic Procedures in Visual Basic https://msdn.microsoft.com/en-us/library/y6yz79c3(d=printer).aspx 1 of 3 02.09.2016 18:50 Procedures in Visual Basic Visual Studio 2015 A procedure is a block of Visual Basic

More information

Watch the video below to learn more about number formats in Excel. *Video removed from printing pages. Why use number formats?

Watch the video below to learn more about number formats in Excel. *Video removed from printing pages. Why use number formats? Excel 2016 Understanding Number Formats What are number formats? Whenever you're working with a spreadsheet, it's a good idea to use appropriate number formats for your data. Number formats tell your spreadsheet

More information

Slide 1 CS 170 Java Programming 1 The Switch Duration: 00:00:46 Advance mode: Auto

Slide 1 CS 170 Java Programming 1 The Switch Duration: 00:00:46 Advance mode: Auto CS 170 Java Programming 1 The Switch Slide 1 CS 170 Java Programming 1 The Switch Duration: 00:00:46 Menu-Style Code With ladder-style if-else else-if, you might sometimes find yourself writing menu-style

More information

Formulas and Functions

Formulas and Functions Conventions used in this document: Keyboard keys that must be pressed will be shown as Enter or Ctrl. Controls to be activated with the mouse will be shown as Start button > Settings > System > About.

More information

Hands-On-8 Advancing with VBA

Hands-On-8 Advancing with VBA Hands-On-8 Advancing with VBA Creating Event Procedures In this exercise you will create a message box that will display a welcome message to the user each time your database is opened. Before starting

More information

Advanced Financial Modeling Macros. EduPristine

Advanced Financial Modeling Macros. EduPristine Advanced Financial Modeling Macros EduPristine www.edupristine.com/ca Agenda Introduction to Macros & Advanced Application Building in Excel Introduction and context Key Concepts in Macros Macros as recorded

More information

Create your first workbook

Create your first workbook Create your first workbook You've been asked to enter data in Excel, but you've never worked with Excel. Where do you begin? Or perhaps you have worked in Excel a time or two, but you still wonder how

More information

Lecture- 5. Introduction to Microsoft Excel

Lecture- 5. Introduction to Microsoft Excel Lecture- 5 Introduction to Microsoft Excel The Microsoft Excel Window Microsoft Excel is an electronic spreadsheet. You can use it to organize your data into rows and columns. You can also use it to perform

More information

Object Hierarchy. OBJECT.Identifier[.sub_Identifier]

Object Hierarchy. OBJECT.Identifier[.sub_Identifier] Object Hierarchy Most applications consist of many objects arranged in a hierarchy. Objects, Methods, Properties and Variables Each line of code generally has the same structure (which is also known as

More information

DroidBasic Syntax Contents

DroidBasic Syntax Contents DroidBasic Syntax Contents DroidBasic Syntax...1 First Edition...3 Conventions Used In This Book / Way Of Writing...3 DroidBasic-Syntax...3 Variable...4 Declaration...4 Dim...4 Public...4 Private...4 Static...4

More information

ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine.

ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine. 1 PL/SQL INTRODUCTION SQL does not have procedural capabilities. SQL does not provide the programming techniques of condition checking, looping and branching that is required for data before permanent

More information

Use mail merge to create and print letters and other documents

Use mail merge to create and print letters and other documents Use mail merge to create and print letters and other documents Contents Use mail merge to create and print letters and other documents... 1 Set up the main document... 1 Connect the document to a data

More information

Excel 2010: Getting Started with Excel

Excel 2010: Getting Started with Excel Excel 2010: Getting Started with Excel Excel 2010 Getting Started with Excel Introduction Page 1 Excel is a spreadsheet program that allows you to store, organize, and analyze information. In this lesson,

More information

Microsoft Visual Basic 2015: Reloaded

Microsoft Visual Basic 2015: Reloaded Microsoft Visual Basic 2015: Reloaded Sixth Edition Chapter Three Memory Locations and Calculations Objectives After studying this chapter, you should be able to: Declare variables and named constants

More information

Outline. Midterm Review. Using Excel. Midterm Review: Excel Basics. Using VBA. Sample Exam Question. Midterm Review April 4, 2014

Outline. Midterm Review. Using Excel. Midterm Review: Excel Basics. Using VBA. Sample Exam Question. Midterm Review April 4, 2014 Midterm Review Larry Caretto Mechanical Engineering 209 Computer Programming for Mechanical Engineers April 4, 2017 Outline Excel spreadsheet basics Use of VBA functions and subs Declaring/using variables

More information

DATA 301 Introduction to Data Analytics Microsoft Excel VBA. Dr. Ramon Lawrence University of British Columbia Okanagan

DATA 301 Introduction to Data Analytics Microsoft Excel VBA. Dr. Ramon Lawrence University of British Columbia Okanagan DATA 301 Introduction to Data Analytics Microsoft Excel VBA Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca DATA 301: Data Analytics (2) Why Microsoft Excel Visual Basic

More information

Put Final Touches on an Application

Put Final Touches on an Application Put Final Touches on an Application Callahan Chapter 11 Preparing Your Application for Distribution Controlling How Your Application Starts Forms-based bound forms for data presentation dialog boxes Switchboard

More information

A Fast Review of C Essentials Part II

A Fast Review of C Essentials Part II A Fast Review of C Essentials Part II Structural Programming by Z. Cihan TAYSI Outline Fixed vs. Automatic duration Scope Global variables The register specifier Storage classes Dynamic memory allocation

More information

Respond to Errors and Unexpected Conditions

Respond to Errors and Unexpected Conditions Respond to Errors and Unexpected Conditions Callahan Chapter 7 Practice Time Artie s List Loose Ends ensure that frmrestaurant s module has Option Explicit modify tblrestaurant field sizes Restaurant -

More information

Documentation of DaTrAMo (Data Transfer- and Aggregation Module)

Documentation of DaTrAMo (Data Transfer- and Aggregation Module) 1. Introduction Documentation of DaTrAMo (Data Transfer- and Aggregation Module) The DaTrAMo for Microsoft Excel is a solution, which allows to transfer or aggregate data very easily from one worksheet

More information

Excel VBA. Microsoft Excel is an extremely powerful tool that you can use to manipulate, analyze, and present data.

Excel VBA. Microsoft Excel is an extremely powerful tool that you can use to manipulate, analyze, and present data. Excel VBA WHAT IS VBA AND WHY WE USE IT Microsoft Excel is an extremely powerful tool that you can use to manipulate, analyze, and present data. Sometimes though, despite the rich set of features in the

More information

SPARK-PL: Introduction

SPARK-PL: Introduction Alexey Solovyev Abstract All basic elements of SPARK-PL are introduced. Table of Contents 1. Introduction to SPARK-PL... 1 2. Alphabet of SPARK-PL... 3 3. Types and variables... 3 4. SPARK-PL basic commands...

More information

CSE 230 Intermediate Programming in C and C++ Functions

CSE 230 Intermediate Programming in C and C++ Functions CSE 230 Intermediate Programming in C and C++ Functions Fall 2017 Stony Brook University Instructor: Shebuti Rayana shebuti.rayana@stonybrook.edu http://www3.cs.stonybrook.edu/~cse230/ Concept of Functions

More information

Excel Programming with VBA (Macro Programming) 24 hours Getting Started

Excel Programming with VBA (Macro Programming) 24 hours Getting Started Excel Programming with VBA (Macro Programming) 24 hours Getting Started Introducing Visual Basic for Applications Displaying the Developer Tab in the Ribbon Recording a Macro Saving a Macro-Enabled Workbook

More information

Introduction to Data Entry and Data Types

Introduction to Data Entry and Data Types 212 Chapter 4 Variables and Arithmetic Operations STEP 1 With the Toolbox visible (see Figure 4-21), click the Toolbox Close button. The Toolbox closes and the work area expands in size.to reshow the Toolbox

More information

KEYBOARD SHORTCUTS AND HOT KEYS

KEYBOARD SHORTCUTS AND HOT KEYS KEYBOARD SHORTCUTS AND HOT KEYS Page 1 This document is devoted to using the keyboard instead of the mouse to perform tasks within applications. This list is by no means the "be all and end all". There

More information

Chapter 4 Defining Classes I

Chapter 4 Defining Classes I Chapter 4 Defining Classes I This chapter introduces the idea that students can create their own classes and therefore their own objects. Introduced is the idea of methods and instance variables as the

More information

Chapter 6 Introduction to Defining Classes

Chapter 6 Introduction to Defining Classes Introduction to Defining Classes Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives Design and implement a simple class from user requirements. Organize a program in terms of

More information

Learning Excel VBA. About Variables. ComboProjects. Prepared By Daniel Lamarche

Learning Excel VBA. About Variables. ComboProjects. Prepared By Daniel Lamarche Learning Excel VBA About Variables Prepared By Daniel Lamarche ComboProjects About Variables By Daniel Lamarche (Last update February 2017). The term variables often send shivers in the back of many learning

More information

KEYWORDS DDE GETOBJECT PATHNAME CLASS VB EDITOR WITHEVENTS HMI 1.0 TYPE LIBRARY HMI.TAG

KEYWORDS DDE GETOBJECT PATHNAME CLASS VB EDITOR WITHEVENTS HMI 1.0 TYPE LIBRARY HMI.TAG Document Number: IX_APP00113 File Name: SpreadsheetLinking.doc Date: January 22, 2003 Product: InteractX Designer Application Note Associated Project: GetObjectDemo KEYWORDS DDE GETOBJECT PATHNAME CLASS

More information

Not For Sale. Using and Writing Visual Basic for Applications Code. Creating VBA Code for the Holland Database. Case Belmont Landscapes

Not For Sale. Using and Writing Visual Basic for Applications Code. Creating VBA Code for the Holland Database. Case Belmont Landscapes Objectives Tutorial 11 Session 11.1 Learn about Function procedures (functions), Sub procedures (subroutines), and modules Review and modify an existing subroutine in an event procedure Create a function

More information

MODULE III: NAVIGATING AND FORMULAS

MODULE III: NAVIGATING AND FORMULAS MODULE III: NAVIGATING AND FORMULAS Copyright 2012, National Seminars Training Navigating and Formulas Using Grouped Worksheets When multiple worksheets are selected, the worksheets are grouped. If you

More information

BasicScript 2.25 User s Guide. May 29, 1996

BasicScript 2.25 User s Guide. May 29, 1996 BasicScript 2.25 User s Guide May 29, 1996 Information in this document is subject to change without notice. No part of this document may be reproduced or transmitted in any form or by any means, electronic

More information

INTRODUCTION... 1 UNDERSTANDING CELLS... 2 CELL CONTENT... 4

INTRODUCTION... 1 UNDERSTANDING CELLS... 2 CELL CONTENT... 4 Introduction to Microsoft Excel 2016 INTRODUCTION... 1 The Excel 2016 Environment... 1 Worksheet Views... 2 UNDERSTANDING CELLS... 2 Select a Cell Range... 3 CELL CONTENT... 4 Enter and Edit Data... 4

More information

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials Fundamentals We build up instructions from three types of materials Constants Expressions Fundamentals Constants are just that, they are values that don t change as our macros are executing Fundamentals

More information

Skill Set 3. Formulas

Skill Set 3. Formulas Skill Set 3 Formulas By the end of this Skill Set you should be able to: Create Simple Formulas Understand Totals and Subtotals Use Brackets Select Cells with the Mouse to Create Formulas Calculate Percentages

More information

12/22/11. Java How to Program, 9/e. public must be stored in a file that has the same name as the class and ends with the.java file-name extension.

12/22/11. Java How to Program, 9/e. public must be stored in a file that has the same name as the class and ends with the.java file-name extension. Java How to Program, 9/e Education, Inc. All Rights Reserved. } Covered in this chapter Classes Objects Methods Parameters double primitive type } Create a new class (GradeBook) } Use it to create an object.

More information

Syntax. Table of Contents

Syntax. Table of Contents Syntax Table of Contents First Edition2 Conventions Used In This Book / Way Of Writing..2 KBasic-Syntax..3 Variable.4 Declaration4 Dim4 Public..4 Private.4 Protected.4 Static.4 As..4 Assignment4 User Defined

More information

Full file at

Full file at Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class

More information

MICROSOFT EXCEL 2000 LEVEL 5 VBA PROGRAMMING INTRODUCTION

MICROSOFT EXCEL 2000 LEVEL 5 VBA PROGRAMMING INTRODUCTION MICROSOFT EXCEL 2000 LEVEL 5 VBA PROGRAMMING INTRODUCTION Lesson 1 - Recording Macros Excel 2000: Level 5 (VBA Programming) Student Edition LESSON 1 - RECORDING MACROS... 4 Working with Visual Basic Applications...

More information

M.EC201 Programming language

M.EC201 Programming language Power Engineering School M.EC201 Programming language Lecture 13 Lecturer: Prof. Dr. T.Uranchimeg Agenda The union Keyword typedef and Structures What Is Scope? External Variables 2 The union Keyword The

More information

Access VBA programming

Access VBA programming Access VBA programming TUTOR: Andy Sekiewicz MOODLE: http://moodle.city.ac.uk/ WEB: www.staff.city.ac.uk/~csathfc/acvba The DoCmd object The DoCmd object is used to code a lot of the bread and butter operations

More information

Appendix A1 Visual Basics for Applications (VBA)

Appendix A1 Visual Basics for Applications (VBA) Credit Risk Modeling Using Excel and VBA with DVD By Gunter Löffler and Peter N. Posch 2011 John Wiley & Sons, Ltd. Appendix A1 Visual Basics for Applications (VBA) MACROS AND FUNCTIONS In this book, we

More information

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel Excel contains numerous tools that are intended to meet a wide range of requirements. Some of the more specialised tools are useful to only certain types of people while others have

More information

Chapter11 practice file folder. For more information, see Download the practice files in this book s Introduction.

Chapter11 practice file folder. For more information, see Download the practice files in this book s Introduction. Make databases user friendly 11 IN THIS CHAPTER, YOU WILL LEARN HOW TO Design navigation forms. Create custom categories. Control which features are available. A Microsoft Access 2013 database can be a

More information

Spreadsheet definition: Starting a New Excel Worksheet: Navigating Through an Excel Worksheet

Spreadsheet definition: Starting a New Excel Worksheet: Navigating Through an Excel Worksheet Copyright 1 99 Spreadsheet definition: A spreadsheet stores and manipulates data that lends itself to being stored in a table type format (e.g. Accounts, Science Experiments, Mathematical Trends, Statistics,

More information

COP 3330 Final Exam Review

COP 3330 Final Exam Review COP 3330 Final Exam Review I. The Basics (Chapters 2, 5, 6) a. comments b. identifiers, reserved words c. white space d. compilers vs. interpreters e. syntax, semantics f. errors i. syntax ii. run-time

More information

DOWNLOAD PDF MICROSOFT EXCEL ALL FORMULAS LIST WITH EXAMPLES

DOWNLOAD PDF MICROSOFT EXCEL ALL FORMULAS LIST WITH EXAMPLES Chapter 1 : Examples of commonly used formulas - Office Support A collection of useful Excel formulas for sums and counts, dates and times, text manipularion, conditional formatting, percentages, Excel

More information

CSE 123 Introduction to Computing

CSE 123 Introduction to Computing CSE 123 Introduction to Computing Lecture 6 Programming with VBA (Projects, forms, modules, variables, flowcharts) SPRING 2012 Assist. Prof. A. Evren Tugtas Starting with the VBA Editor Developer/Code/Visual

More information

Using Microsoft Access

Using Microsoft Access Using Microsoft Access USING MICROSOFT ACCESS 1 Interfaces 2 Basic Macros 2 Exercise 1. Creating a Test Macro 2 Exercise 2. Creating a Macro with Multiple Steps 3 Exercise 3. Using Sub Macros 5 Expressions

More information

Using Parameter Queries

Using Parameter Queries [Revised and Updated 21 August 2018] A useful feature of the query is that it can be saved and used again and again, whenever we want to ask the same question. The result we see (the recordset) always

More information

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6)

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6) Technology & Information Management Instructor: Michael Kremer, Ph.D. Database Program: Microsoft Access Series DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6) Section 4 AGENDA 7. Working

More information

CROSSREF Manual. Tools and Utilities Library

CROSSREF Manual. Tools and Utilities Library Tools and Utilities Library CROSSREF Manual Abstract This manual describes the CROSSREF cross-referencing utility, including how to use it with C, COBOL 74, COBOL85, EXTENDED BASIC, FORTRAN, Pascal, SCREEN

More information

Formulas, LookUp Tables and PivotTables Prepared for Aero Controlex

Formulas, LookUp Tables and PivotTables Prepared for Aero Controlex Basic Topics: Formulas, LookUp Tables and PivotTables Prepared for Aero Controlex Review ribbon terminology such as tabs, groups and commands Navigate a worksheet, workbook, and multiple workbooks Prepare

More information

A A B U n i v e r s i t y

A A B U n i v e r s i t y A A B U n i v e r s i t y Faculty of Computer Sciences O b j e c t O r i e n t e d P r o g r a m m i n g Week 4: Introduction to Classes and Objects Asst. Prof. Dr. M entor Hamiti mentor.hamiti@universitetiaab.com

More information

OpenForms360 Validation User Guide Notable Solutions Inc.

OpenForms360 Validation User Guide Notable Solutions Inc. OpenForms360 Validation User Guide 2011 Notable Solutions Inc. 1 T A B L E O F C O N T EN T S Introduction...5 What is OpenForms360 Validation?... 5 Using OpenForms360 Validation... 5 Features at a glance...

More information

Function: function procedures and sub procedures share the same characteristics, with

Function: function procedures and sub procedures share the same characteristics, with Function: function procedures and sub procedures share the same characteristics, with one important difference- function procedures return a value (e.g., give a value back) to the caller, whereas sub procedures

More information

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 10: OCT. 6TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 10: OCT. 6TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 10: OCT. 6TH INSTRUCTOR: JIAYIN WANG 1 Notice Assignments Reading Assignment: Chapter 3: Introduction to Parameters and Objects The Class 10 Exercise

More information

Java Primer 1: Types, Classes and Operators

Java Primer 1: Types, Classes and Operators Java Primer 1 3/18/14 Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and M. H. Goldwasser, Wiley, 2014 Java Primer 1: Types,

More information

LmÉPï C Á npï À ƵÀ ïì itech Analytic Solutions

LmÉPï C Á npï À ƵÀ ïì itech Analytic Solutions LmÉPï C Á npï À ƵÀ ïì itech Analytic Solutions No. 9, 1st Floor, 8th Main, 9th Cross, SBM Colony, Brindavan Nagar, Mathikere, Bangalore 560 054 Email: itechanalytcisolutions@gmail.com Website: www.itechanalytcisolutions.com

More information

I OFFICE TAB... 1 RIBBONS & GROUPS... 2 OTHER SCREEN PARTS... 4 APPLICATION SPECIFICATIONS... 5 THE BASICS...

I OFFICE TAB... 1 RIBBONS & GROUPS... 2 OTHER SCREEN PARTS... 4 APPLICATION SPECIFICATIONS... 5 THE BASICS... EXCEL 2010 BASICS Microsoft Excel I OFFICE TAB... 1 RIBBONS & GROUPS... 2 OTHER SCREEN PARTS... 4 APPLICATION SPECIFICATIONS... 5 THE BASICS... 6 The Mouse... 6 What Are Worksheets?... 6 What is a Workbook?...

More information

What are the characteristics of Object Oriented programming language?

What are the characteristics of Object Oriented programming language? What are the various elements of OOP? Following are the various elements of OOP:- Class:- A class is a collection of data and the various operations that can be performed on that data. Object- This is

More information

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview Introduction to Visual Basic and Visual C++ Introduction to Java Lesson 13 Overview I154-1-A A @ Peter Lo 2010 1 I154-1-A A @ Peter Lo 2010 2 Overview JDK Editions Before you can write and run the simple

More information

Procedural programs are ones in which instructions are executed in the order defined by the programmer.

Procedural programs are ones in which instructions are executed in the order defined by the programmer. Procedural programs are ones in which instructions are executed in the order defined by the programmer. Procedural languages are often referred to as third generation languages and include FORTRAN, ALGOL,

More information

Start Visual Basic. Session 1. The User Interface Form (I/II) The Visual Basic Programming Environment. The Tool Box (I/II)

Start Visual Basic. Session 1. The User Interface Form (I/II) The Visual Basic Programming Environment. The Tool Box (I/II) Session 1 Start Visual Basic Use the Visual Basic programming environment Understand Essential Visual Basic menu commands and programming procedure Change Property setting Use Online Help and Exit Visual

More information

Acknowledgments Introduction. Chapter 1: Introduction to Access 2007 VBA 1. The Visual Basic Editor 18. Testing Phase 24

Acknowledgments Introduction. Chapter 1: Introduction to Access 2007 VBA 1. The Visual Basic Editor 18. Testing Phase 24 Acknowledgments Introduction Chapter 1: Introduction to Access 2007 VBA 1 What Is Access 2007 VBA? 1 What s New in Access 2007 VBA? 2 Access 2007 VBA Programming 101 3 Requirements-Gathering Phase 3 Design

More information

CS103 Spring 2018 Mathematical Vocabulary

CS103 Spring 2018 Mathematical Vocabulary CS103 Spring 2018 Mathematical Vocabulary You keep using that word. I do not think it means what you think it means. - Inigo Montoya, from The Princess Bride Consider the humble while loop in most programming

More information

static CS106L Spring 2009 Handout #21 May 12, 2009 Introduction

static CS106L Spring 2009 Handout #21 May 12, 2009 Introduction CS106L Spring 2009 Handout #21 May 12, 2009 static Introduction Most of the time, you'll design classes so that any two instances of that class are independent. That is, if you have two objects one and

More information

Lecture 18 Tao Wang 1

Lecture 18 Tao Wang 1 Lecture 18 Tao Wang 1 Abstract Data Types in C++ (Classes) A procedural program consists of one or more algorithms that have been written in computerreadable language Input and display of program output

More information