Download presentation
Presentation is loading. Please wait.
Published byHilary Lindsey Modified over 9 years ago
1
Microsoft Access Using Visual Basic Routines
2
Visual Basic Datatypes Boolean Byte Currency Date Double Integer Long Object Single String Variant Hyperlink
3
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
4
Initializations intVariable = 10 stringVariable = “Hello, world.” dateVariable = #02/02/2001#
5
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
6
Selection Structures If Then statement1 statement2 Else statement3 statement4 End If
7
Selection Structures Select Case Case statements… Case statements… Case Else statements... End Select
8
Loops For = To statement 1... statement2... Next
9
Loops (contd…) Do Until statement 1... statement 2... Loop
10
Procedures Sub ( ) … Code for the procedure … End Sub
11
Data Objects DAO = Data Access Object RDO = Remote Data Object RDS = Remote Data Services ADO = ActiveX Data Object
12
Useful DAOs DAO = Data Access Object Database RecordSet
13
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
14
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”)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.